CompositeUserType « Composite « JPA Q&A





1. CompositeUserType for Composite Keys w/ Generated Identities    forum.hibernate.org

I am trying to map a table that contains a composite key structure of a surrogate-key and an effective date. Searching through the Hibernate forums it appears that the only solution is to use a CompositeUserType that will allow one to map a table that uses generated identities: http://forum.hibernate.org/viewtopic.php?t=969576 Executing my initial attempt at this, the id returned is still 0. ...

2. Composite index with CompositeUserType & identifiergener    forum.hibernate.org

Hi , when implementing a composite index with the above configuratin (as i understand it's the only way) does that mean i have three DB hits per save ? get last value (assuming table generator type of impl.) update value , save new entity ? is there a better way to workaround it ?