Hi all,
I'm a bit lost with the different types of generators available with Hibernate. Basically, I have an Oracle DB which has sequences for (most of) its tables. Now, I gathered from other posts that the way to use those sequences is to specify the following in my class.hbm.xml :
Code:
<id column="IDSTRUCT" name="idstruct" type="java.lang.Long">
<generator class="sequence">
<param name="sequence">my_schema.my_seq_name</param>
</generator>
</id>
However, it seems to me that I could also use class="assigned" and use the
Code:
OracleDialect.getSequenceNextValString(my_seq_name)
method to achieve the same result. My question, therefore, is two-fold :
1. Will those two methods actually do the same thing?
2. If so, which should I use? I'd be very tempted to go with the first one, if not for the fact that I got a sample .hbm.xml mapping file from another programmer here where he used class "assigned". Unfortunately, that's all he sent me (I don't have the underlying code) and he has so far failed to answer my e-mails, so I don't know the rest of the story.
Thanks in advance for shedding some light on this.
Laurent