java - Hibernate hbm2ddl with synonyms -


i've added synonyms our db. these synonyms hold entire entity information, hence have own mapping file. connecting synonyms not issue. issue when using hbm2ddl tool.

if include synonym mapping files, hbm2ddl tool creates synonym table normal table, should ignored. i'm not sure how flag entity mapping synonym (or if possible) , restrain hibernate creating new table synonym.

if exclude mapping files, tool not pass validation since other files refer synonym entities. example:

   <many-to-one name="creator" class="com.entities.mysynonymentity"  cascade="refresh" foreign-key="my_synm_fkc" not-null="false" lazy="proxy" fetch="select">         <column name="my_synm_fk" not-null="false"  sql-type="number(19)"  />     </many-to-one> 

here mapping file belong entity lives in true database refers entity data populated synonym.

what correct way setup mapping files hbm2ddl tool when synonyms of involved?

thanks much, jp

i think hbm2ddl works tables , not synonyms.i suggest keep value hibernate.hbm2ddl.auto= "" rather validation.

same discussion went in hibernate forums

https://forum.hibernate.org/viewtopic.php?p=2438033


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -