specify Sequence generator for non-ID column

242 views
Skip to first unread message

fel0nious

unread,
Dec 1, 2010, 1:28:45 PM12/1/10
to nhusers, fluent-n...@googlegroups.com
is this possible?

The business requirements consist of a key for the table (also
generated by sequence), and an additional user-friendly value which is
generated by a sequence.

fel0nious

unread,
Dec 1, 2010, 2:23:00 PM12/1/10
to Fluent NHibernate, nhu...@googlegroups.com
I found this over on StackOverflow:
Fluent Nhibernate - Generate a non-primary-key sequence generated
value
http://j.mp/h0wr3h

.. which indicates the only solution might be to hook into
OnPreInsert, making a standard query to invoke the sequence and get
its value.

Is this really the best I can do? Seems like waste to make an extra
database call on insert ...

Reply all
Reply to author
Forward
0 new messages