java - native generator class in hibernate -


i have part of hibernate mapping xml file, , looking example native mean.

<hibernate-mapping>  <class name="com.hib.task" table="tasks">   <id name="id" type="int" column="id" >    <generator class="native"/>   </id> 

i know it's related unique identifier property, have example.

sorry newbie question, i'm new hibernate , programming in general :) thank you!

native means generator use identity or sequence columns according current database support.

native: generation strategy default. chooses primary key generation strategy default database in question, quite typically identity, although might table or sequence depending upon how database configured. native strategy typically recommended, makes code , applications portable.

for example: in mysql if have primary key column auto_increment, db updated using strategy


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -