CompositeUserType « Composite « JPA Q&A

1. CompositeUserType for Composite Keys w/ Generated Identities

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: Executing my initial attempt at this, the id returned is still 0. ...

2. Composite index with CompositeUserType & identifiergener

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 ?