Damian wrote: ... > > The challenge is generating the 'index' value for the > > 'alarm_group_emailcontacts' table entries. It seems like > there should > > be a sequence for this table, but there isn't. > > That's because it's an index not the ID. And 'email contact' > is defined as 'component' not as an 'entity'. (Please read > Hibernate docs on components vs. entities). 'index' field is > used to determine the order in the table. > Quite frankly I am not sure if order even matters here - we > could have probably mapped it as a 'bag' as not as a 'list' > which would let us to drop index column altogether.
Ah, I see. Having the order of the entries maintained give me, as a user, a warm fuzzy feeling. But I see your point. > Yes. When you inserting new data from SQL you'll need to use > sequence for 'alarm_group_id' but you can generate you > 'index' as long as it starts with 0 and is consecutive. I will strive to use 'alarm_group_seq', but it isn't working when I run my in-progress SQL patch manually with psql: ERROR: currval of sequence "alarm_group_seq" is not yet defined in this session I'm pretty sure SQL patches are also applied with psql upon upgrade, so possibly the same error would occur. On the other hand migrate-2.8.sql used sequences, so maybe it will just plain work. -Paul [email protected] _______________________________________________ sipx-dev mailing list [email protected] List Archive: http://list.sipfoundry.org/archive/sipx-dev Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev sipXecs IP PBX -- http://www.sipfoundry.org/
