harshad kadam

Greenhorn
+ Follow
since Mar 19, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by harshad kadam

ntumba lobo wrote:why are you using "property-ref" in your Employee mapping ?
It is not necessary to establish the one-to-one relationship unless you work with legacy database.
It could be the problem.




I reffered "property-ref" from this tutorial.

As per your advice i removed "property-ref" but didn't work for me. Problem persists.
hello,
i am beginner to hibernate. please guide me with one to one mapping.

DB table structure:





Employee.java



EmployeeContact.java


Employee.hbm.xml


EmployeeContact.hbm.xml


Here in EmployeeBean.java, i construct employee object



Here in EmployeeDaoImpl.java i save the employee object





The problem is one to one mapping. The EmployeeContact object gets saved except employee_id. EMPLOYEE_ID remains null in EMPLOYEE_CONTACT table. Please guide me where the configuration is fallen short.
Hello,
I have one simple login service implemented in a servlet.


here i get the session id for this servlet context. To authenticate user later in other service, i have other method which matches the session id generated at after login, with currentSessId = request.getSession(false).getId();

where, validateSession method matches currentSessId with sessionId dat was generated at login time (which comes through URL request).

This approach is working fine when i access the this servlet through ip, means
http://192.168.5.9:8080/MyProj/MyServlet?_service=login&_param={%27username%27:%27admin%27,%20%27password%27:%27admin%27}

But when i access application through domain, it is creating new session Id every time i make the request.
http://local.myproj.com/MyServlet?_service=login&_param={%27username%27:%27admin%27,%20%27password%27:%27admin%27}


Please advice me what is going wrong here?
13 years ago
the properties "updatedUserId.officerName" & "logSheet.status" are not being resolved!
I am using criteria to select some records from DB with restrictions on it. I have one table say A & its pojo A.java, its field mapped with other table B. (many-to-one).
When i use criteria with restriction, the id (which is the primary key of ) of other class is mapped in the property field. But when i give some other variable from B.java, it gives "could not resolve property" excepion.
Why this happens?

here is the code:



yes..it worked.. i had written [!callback.equals(null)] i changed it to [callback != null]. resolved.
14 years ago
in servlet i am taking value from URL String callback = request.getParameter("_callback"); problem is &_callback can be there or not, i am getting nullPointerException if &_callback is not there in URL. I tried to catch the exception but didn't work. is there any way to check whether request.getParameter() is null or not? if it is null, i want to execute a part of code and if not, other part.
14 years ago
i am using hibernate. Is it possible to write a system file containing database information which will reflect to hibernate.cfg.xml ??