I am developing a project in which I save some POJOs by adding Hibernate annotations. One of the problems I ran into is that such code does not work, since Hibernate is trying to match the subfields in Time_T in one column (i.e. startTime.sec and stopTime.sec both try to match with colum sec , causing an error )
@Entity public class ExampleClass { @Id long eventId; Time_T startTime; Time_T stopTime; } @Embeddable public class Time_T { int sec; int nsec; }
Since there will be many such events in the system, it would be nice if it were possible to automatically add a prefix to the column name (for example, make the columns startTime_sec , startTime_nsec , stopTime_sec , stopTime_nsec ), without the need to apply overrides for each field. Does Hibernate have this feature or is there any other reasonable work?
java orm hibernate
VeeArr Jun 15 '10 at 15:34 2010-06-15 15:34
source share