smitha eliz joshi

+ Follow
since Aug 30, 2012
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by smitha eliz joshi

Poornima Sharma wrote:Hi Smitha,

Nice post. I am still looking for the contents regarding the topics you pointed out:-

DP / Best practices / Deployment / Security

Please let me know if you find something good.

I have also just started preparing for JWS 6, and believe RMH book ch. 22, 23, 24 would be helpful to build a base for these topics.
Once we have some understanding of these topics, then one can google for specific topics & issues or discuss here.
JWS certification Objectives & Oracle suggested training material

Possible Study Material to Read -

Hello Bill,

Thank you for your reply.

Also, I am sorry for posting bad info in above case,
actually, Entity was written by someone else, and Id was @Generated; and since that id is based on combination of diff info, I need to set it in entity.
Once I commented @Gen annotation from Entity id, merge() works good for all entities in the list.

I am putting list of entities,

if I use persist for entire list, I am getting following
java.lang.Exception: javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist:
because entity with same id exists in DB

if I use merge for entire list, I am getting following
java.lang.Exception: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not insert:
ORA-01400: cannot insert NULL into
because entity does not exists

does that mean I would need to check which entity exist & which not
and use appropriate method with entitymanager?

thanks & regards.

lokesh chenta wrote:"Iterating over the entities and saving them into the required HashMap or whatever collection". This seems to be fine and I don't see anything wrong with this approach.
Though I have not tried, the following links to seems to talk about returning a map from the queries...

Hope that helps..

thanks for your reply...

I am new to Hibernate and my query is retrieving entities.

Entity has simple string properties.

one of the property is key (id). I need these entities as detached & need to do read only.

I am thinking to put these entities in hashmap & using id property as key in hashmap.

I am thinking to do it in Java (iterate collection of entities & save in hashmap).

I believe this is not correct way & there would be way to get the retrieved collection in hashmap directly.

Can you please suggest key-word to google I should look for to read on this OR any link/example to this case ?