-
1. Re: Auditing entities with multiple @Id columns
adamw Oct 7, 2010 2:27 AM (in response to nickarls)Hello,
could you please take a look at:
and say how does your setup differ from the one in the test? (I suspect you have a multiple id - so the entity to compare is MulIdTestEntity).
Adam
-
2. Re: Auditing entities with multiple @Id columns
nickarls Oct 7, 2010 2:37 AM (in response to adamw)At first glance it appears that MulIdTestEntity has the @IdClass approach.
Granted, the multiple @Id is hibernate-specific so perhaps I should use @EmbeddedId/@IdClass and separate component key class...
-
3. Re: Auditing entities with multiple @Id columns
adamw Oct 7, 2010 2:39 AM (in response to nickarls)You don't have an @IdClass on your entity? Then how do you retrieve entities by id?
Adam
-
4. Re: Auditing entities with multiple @Id columns
nickarls Oct 7, 2010 2:43 AM (in response to adamw)I don't have to, a query returns a list and I start working on them by passing them as an EL-parameter into a conversation scoped component that merges them into the extended PC ;-)
But yes, I guess the move to @IdClass would have happened at some point anyway...
-
5. Re: Auditing entities with multiple @Id columns
adamw Oct 7, 2010 2:46 AM (in response to nickarls)Heh Well it should be just adding the annotation plus a simple class. Let me know if adding @IdClass helps (I think it should).
Adam
-
6. Re: Auditing entities with multiple @Id columns
nickarls Oct 7, 2010 3:29 AM (in response to adamw)Got it rolling on by switching to @EmbeddedId:s. Now it stops at
Caused by: org.hibernate.MappingException: Could not determine type for: custom_yesno, at table: foo_AUD, for columns: [org.hibernate.mapping.Column(active)] which is a custom @Type. Any workarounds for this? ;-)
-
7. Re: Auditing entities with multiple @Id columns
adamw Oct 7, 2010 4:04 AM (in response to nickarls)Does your type implement UserType or similar?
The test case to compare to is now:
Adam