<id name="message_id" column="message_id">
<generator class="native"/>
</id>
Above typical example of using generator for ID column, I need auto-generating column in my project but not ID.
Hibernate has a concept of generated properties, though it can be used only when values are generated at the database side, i.e. it's an equivalent of <generator class = "identity" />, other generators cannot be used:
<property name = "message_id" generated = "insert" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With