All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hbm.persistentclass.hbm.ftl Maven / Gradle / Ivy

There is a newer version: 5.6.15.Final
Show newest version
<${c2h.getTag(clazz)}
    name="${c2h.getClassName(clazz)}"
<#if !c2h.getClassName(clazz).equals(clazz.entityName)>
    entity-name="${clazz.entityName}"

<#if clazz.superclass?exists>
    extends="${clazz.getSuperclass().className}"

<#if c2h.needsTable(clazz)>
    table="${clazz.table.quotedName}"

<#if !c2h.isSubclass(clazz) && clazz.table.schema?exists>
    schema="${clazz.table.quotedSchema}"

<#if !c2h.isSubclass(clazz) && clazz.table.catalog?exists>
    catalog="${clazz.table.catalog}"

<#if !clazz.mutable>
    mutable="false"

<#if clazz.useDynamicUpdate()>
    dynamic-update="true"

<#if clazz.useDynamicInsert()>
    dynamic-insert="true"

<#if clazz.hasSelectBeforeUpdate()>
    select-before-update="true"

<#if c2h.needsDiscriminator(clazz)>
    discriminator-value="${clazz.discriminatorValue}"

<#if clazz.isExplicitPolymorphism()>
    polymorphism="explicit"

<#if clazz.isLazy() && !c2h.getClassName(clazz).equals(c2h.getProxyInterfaceName(clazz))>
    proxy="${c2h.getProxyInterfaceName(clazz)}"
<#elseif !clazz.isLazy()>
    lazy="false"

<#if clazz.isAbstract()?exists && clazz.isAbstract()>
    abstract="true"

<#if c2h.isClassLevelOptimisticLockMode(clazz)>
    optimistic-lock="${c2h.getClassLevelOptimisticLockMode(clazz)}"

<#if (clazz.batchSize>1)>
    batch-size="${clazz.batchSize}"

<#if clazz.where?exists>
    where="${clazz.where}"

<#if clazz.table.subselect>
    subselect="${clazz.table.getSubselect()}"

<#if c2h.hasCustomEntityPersister(clazz)>
    persister="${clazz.getEntityPersisterClass().name}"

<#if clazz.table.rowId?exists>
    rowid="${clazz.table.rowId}"
>
<#assign metaattributable=clazz/>
<#include "meta.hbm.ftl"/>

<#if clazz.table.comment?exists  && clazz.table.comment?trim?length!=0>
 ${clazz.table.comment}

<#-- TODO: move this to id.hbm.ftl -->
<#if !c2h.isSubclass(clazz)>
 <#if clazz.hasIdentifierProperty()>
 <#assign property=clazz.getIdentifierProperty()/>
 <#include "id.hbm.ftl"/>
 <#elseif clazz.hasEmbeddedIdentifier()>
 <#assign embeddedid=clazz.key/>
 <#include "id.hbm.ftl"/>
 <#elseif clazz.identifier?exists>
 	<#if c2j.isComponent(clazz.identifier)>
 	 	mapped="true">
        	<#foreach property in clazz.identifier.propertyIterator>
        		
        		<#foreach column in property.value.columnIterator>
        		<#include "column.hbm.ftl">
 			
 			
 		
        	
 	<#else>
 		 
		 <#foreach column in clazz.identifier.columnIterator>
        	<#include "column.hbm.ftl">
 		
 		
 	
 
<#elseif c2h.isJoinedSubclass(clazz)>
 
       <#foreach column in clazz.key.columnIterator>
                <#include "column.hbm.ftl">
       
 


<#if c2h.needsDiscriminatorElement(clazz)>
    
    	<#foreach column in clazz.discriminator.columnIterator>
        	<#include "column.hbm.ftl">
  	
    



<#-- version has to be done explicitly since Annotation's does not list version first -->
<#if pojo.hasVersionProperty()>
<#assign property=clazz.getVersion()/>
<#include "${c2h.getTag(property)}.hbm.ftl"/>


<#foreach property in c2h.getProperties(clazz)>
<#if c2h.getTag(property)!="version" && c2h.getTag(property)!="timestamp">
<#include "${c2h.getTag(property)}.hbm.ftl"/>



<#foreach join in clazz.joinIterator>
 
     table="${join.table.name}"
 >
 <#if join.table.comment?exists  && join.table.comment?trim?length!=0>
   ${comment}
 
   
 <#foreach column in join.key.columnIterator>
  <#include "column.hbm.ftl">
 
   
 <#foreach property in join.propertyIterator>
  <#include "${c2h.getTag(property)}.hbm.ftl"/>
 
  







© 2015 - 2024 Weber Informatics LLC | Privacy Policy