java - Migrating Hibernate 3 to 5: relation hibernate_sequence does not exist -


i migrating application running hibernate 3 hibernate 5.

i have strange error:

error: relation hibernate_sequence not exist

we using *.hbm.xml mapping files , working fine until changed hibernate version. mean have pretty straight forward mapping id column , db sequence generator , still hibernate wasn't able pick correct config.

<hibernate-mapping>     <class name="com.boyan.myclass" table="my_class">        <id name="id" type="long">             <column name="id" />             <generator class="sequence">                <param name="sequence">my_class_seq</param>             </generator>         </id> ...     </class> </hibernate-mapping> 

i started digging in hibernate code , saw sequencegenerator deprecated , new versions use sequencestylegenerator. confused when noticed in new version property telling sequence name changed sequence sequence_name. when changed:

<param name="sequence">my_class_seq</param> 

to:

<param name="sequence_name">my_class_seq</param> 

everything worked.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -