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

dict.jeddict.6.4.0.source-code.beanclasstemplate.ftl Maven / Gradle / Ivy

Go to download

Jeddict is an open source Jakarta EE application development platform that accelerates developers productivity and simplifies development tasks of creating complex entity relationship models.

There is a newer version: 6.5.0
Show newest version
<#-- custom snippet - before package -->
<#if classDef.getCustomSnippet("BEFORE_PACKAGE")?has_content>
<#foreach snippet in classDef.getCustomSnippet("BEFORE_PACKAGE")![]>
${snippet}
${n}

<#-- Package Name definition -->
<#if classDef.getPackageName()?has_content>
    package ${classDef.getPackageName()};

<#-- custom snippet - after package -->
<#if classDef.getCustomSnippet("AFTER_PACKAGE")?has_content>
<#foreach snippet in classDef.getCustomSnippet("AFTER_PACKAGE")![]>
${snippet} 
${n}

<#-- import statements -->
<#foreach importStatement in classDef.getImportSnippets()![]>
${importStatement}

<#-- custom class snippet - import -->
<#foreach snippet in classDef.getCustomSnippet("IMPORT")![]>
${snippet} 

<#-- custom attribute snippet - import -->
<#foreach varDef in classDef.getVariableDefs()>
<#foreach snippet in varDef.getCustomSnippet("IMPORT")![]>
${snippet} 


<#-- java doc -->
<#if classDef.isJavaDocExist()>
${classDef.getJavaDoc()}

<#-- custom class snippet - before class -->
<#if classDef.getCustomSnippet("BEFORE_CLASS")?has_content>
<#foreach snippet in classDef.getCustomSnippet("BEFORE_CLASS")![]>
${snippet} 
${n}

<#-- jaxb annotations -->
<#if classDef.isJaxbSupport()>
@XmlAccessorType(XmlAccessType.FIELD)
<#if classDef.isXmlRootElement()>
@XmlRootElement


<#-- class annotations -->
<#-- class jpa annotations start -->
<#if classDef.getManagedType()?has_content>
${classDef.getManagedType()}
<#if classDef.getTableDef()??>
${classDef.getTableDef().getSnippet()}

<#if (classDef.getInheritance())??>
${classDef.getInheritance().getSnippet()}

<#if classDef.getPrimaryKeyJoinColumns()??>
${classDef.getPrimaryKeyJoinColumns().getSnippet()}

<#if classDef.getSecondaryTables()??>
${classDef.getSecondaryTables().getSnippet()}

<#if classDef.getIdClass()??>
${classDef.getIdClass().getSnippet()}

<#if classDef.getAssociationOverrides()??>
${classDef.getAssociationOverrides().getSnippet()}

<#if classDef.getAttributeOverrides()??>
${classDef.getAttributeOverrides().getSnippet()}

<#if classDef.getSQLResultSetMappings()??>
${classDef.getSQLResultSetMappings().getSnippet()}

<#if classDef.getEntityListeners()??>
${classDef.getEntityListeners().getSnippet()}

<#if classDef.isDefaultExcludeListener()>
@ExcludeDefaultListeners

<#if classDef.isExcludeSuperClassListener()>
@ExcludeSuperclassListeners

<#if (classDef.getDiscriminatorValue())??>
${classDef.getDiscriminatorValue().getSnippet()}

<#if (classDef.getDiscriminatorColumn())??>
${classDef.getDiscriminatorColumn().getSnippet()}

<#if classDef.getCacheableDef()??>
${classDef.getCacheableDef().getSnippet()}

<#if classDef.getConverts()??>
${classDef.getConverts().getSnippet()}

<#--  named queries -->
<#if classDef.getNamedQueries()??>
${classDef.getNamedQueries().getSnippet()}

<#if classDef.getNamedNativeQueries()??>
${classDef.getNamedNativeQueries().getSnippet()}

<#--  named entity graphs -->
<#if classDef.getNamedEntityGraphs()??>
${classDef.getNamedEntityGraphs().getSnippet()}

<#--  named stored procedure -->
<#if classDef.getNamedStoredProcedureQueries()??>
${classDef.getNamedStoredProcedureQueries().getSnippet()}


<#-- class jpa annotations end -->
<#--  JSONB -->
<#foreach snippet in classDef.getJSONBSnippets()![]>
${snippet.getSnippet()}

<#--  custom annotation -->
<#foreach annotation in classDef.getAnnotation("TYPE")![]>
${annotation.getSnippet()}

public<#if classDef.isAbstractClass()> abstract class ${classDef.getClassName()}<#if classDef.isTypeParameterExist()><${classDef.getTypeParameterList()}><#if classDef.getSuperClassName()??> extends ${classDef.getSuperClassName()}<#if classDef.isInterfaceExist()> implements ${classDef.getUnqualifiedInterfaceList()} { 

<#-- custom class snippet - before field -->
<#if classDef.getCustomSnippet("BEFORE_FIELD")?has_content>
<#foreach snippet in classDef.getCustomSnippet("BEFORE_FIELD")![]>
    ${snippet} 
${n}

<#-- member variables -->
<#foreach varDef in classDef.getVariableDefs()>
<#-- custom attribute snippet - before field -->
<#if varDef.getCustomSnippet("BEFORE_FIELD")?has_content>
<#foreach snippet in varDef.getCustomSnippet("BEFORE_FIELD")![]>
    ${snippet} 
${n}

<#if varDef.isPropertyJavaDocExist()>
${varDef.getPropertyJavaDoc()}

<#-- var jpa annotations start -->
<#if classDef.getManagedType()?has_content>
<#if varDef.getTranzient()??>
    ${varDef.getTranzient().getSnippet()}

<#if varDef.getId()??>
    ${varDef.getId().getSnippet()}

<#if varDef.getRelation()??>
    ${varDef.getRelation().getSnippet()}

<#if varDef.getElementCollection()??>
    ${varDef.getElementCollection().getSnippet()}

<#if varDef.getVersion()??>
    ${varDef.getVersion().getSnippet()}

<#if varDef.isEmbedded()>
    @Embedded

<#if varDef.isEmbeddedId()>
    @EmbeddedId

<#if varDef.getLob()??>
    ${varDef.getLob().getSnippet()}

<#if varDef.getBasic()??>
    ${varDef.getBasic().getSnippet()}

<#if varDef.getGeneratedValue()??>
    ${varDef.getGeneratedValue().getSnippet()}

<#if varDef.getTableGenerator()??>
    ${varDef.getTableGenerator().getSnippet()}

<#if varDef.getSequenceGenerator()??>
    ${varDef.getSequenceGenerator().getSnippet()}

<#if varDef.getColumn()??>
    ${varDef.getColumn().getSnippet()}

<#if varDef.getOrderBy()??>
    ${varDef.getOrderBy().getSnippet()}

<#if varDef.getOrderColumn()??>
    ${varDef.getOrderColumn().getSnippet()}

<#if varDef.getMapKey()?has_content>
    ${varDef.getMapKeyString()}

<#if varDef.getJoinColumns()??>
    ${varDef.getJoinColumns().getSnippet()}

<#if varDef.getJoinTable()?has_content>
    ${varDef.getJoinTable().getSnippet()}

<#if varDef.getCollectionTable()?has_content>
    ${varDef.getCollectionTable().getSnippet()}

<#if varDef.getEnumerated()??>
    ${varDef.getEnumerated().getSnippet()}

<#if varDef.getTemporal()??>
    ${varDef.getTemporal().getSnippet()}

<#if varDef.getConverts()??>
    ${varDef.getConverts().getSnippet()}

<#if varDef.getAssociationOverrides()??>
${varDef.getAssociationOverrides().getSnippet()}

<#if varDef.getAttributeOverrides()??>
${varDef.getAttributeOverrides().getSnippet()}


<#-- var jpa annotations end -->
<#foreach annotation in varDef.getAnnotation("PROPERTY")![]>
    ${annotation.getSnippet()}

<#foreach snippet in varDef.getJSONBSnippets()![]>
    ${snippet.getSnippet()}

<#foreach constraint in varDef.getAttributeConstraints()![]>
    ${constraint.getSnippet()}

<#-- var - jaxb annotations -->
<#if classDef.isJaxbSupport()>
<#assign jaxbAnnotationSnippet = varDef.getJaxbAnnotationSnippet()>
<#if jaxbAnnotationSnippet != "">
    ${jaxbAnnotationSnippet}


<#-- $varDef.type => $varDef.getTypeIdentifier().getConstraintVariableType() ## to resolve problem Collection => Collection -->    
    ${varDef.accessModifier} ${varDef.constraintType} ${varDef.name}<#if varDef.getDefaultValue()?has_content> = ${varDef.getDefaultValue()};
<#-- custom attribute snippet - after field -->
<#if varDef.getCustomSnippet("AFTER_FIELD")?has_content>
<#foreach snippet in varDef.getCustomSnippet("AFTER_FIELD")![]>
    ${snippet} 
${n}


<#-- custom class snippet - after field -->
<#if classDef.getCustomSnippet("AFTER_FIELD")?has_content>
<#foreach snippet in classDef.getCustomSnippet("AFTER_FIELD")![]>
    ${snippet}
${n}


<#-- Constructor -->
<#foreach constructor in classDef.getConstructors()>
    ${constructor.getSnippet()}
${n}
<#-- custom class snippet - before method -->
<#if classDef.getCustomSnippet("BEFORE_METHOD")?has_content>
<#foreach snippet in classDef.getCustomSnippet("BEFORE_METHOD")![]>
    ${snippet}
${n}

<#-- getter/setter -->
<#foreach varDef in classDef.getVariableDefs()>
<#-- custom attribute snippet - before method -->
<#if varDef.getCustomSnippet("BEFORE_METHOD")?has_content>
<#foreach snippet in varDef.getCustomSnippet("BEFORE_METHOD")![]>
    ${snippet}
${n}

<#--  getter -->
<#if varDef.isGetterJavaDocExist()>
${varDef.getGetterJavaDoc()}

<#foreach annotation in varDef.getAnnotation("GETTER")![]>
    ${annotation.getSnippet()}

<#assign method = varDef.getMethodName()>
<#assign methodPrefix = varDef.getGetterMethodPrefix()>
    public ${varDef.returnType} ${methodPrefix}${method}() <#if varDef.isGetterThrows()> ${varDef.getGetterThrowsSnippet()}  {
<#-- custom attribute snippet - pre getter -->
<#if varDef.getCustomSnippet("PRE_GETTER")?has_content>
<#foreach snippet in varDef.getCustomSnippet("PRE_GETTER")![]>
        ${snippet}


<#-- custom attribute snippet - getter -->
<#if varDef.getCustomSnippet("GETTER")?has_content>
<#foreach snippet in varDef.getCustomSnippet("GETTER")![]>
    <#if snippet??>
        ${snippet}
    

<#else>
    <#if varDef.getImplementationType()?has_content>
        if(${varDef.name} == null) {
            ${varDef.name} = new ${varDef.getImplementationType()}<>();
        }
    
        return ${varDef.returnValue};

<#-- custom attribute snippet - post getter -->
<#if varDef.getCustomSnippet("POST_GETTER")?has_content>
<#foreach snippet in varDef.getCustomSnippet("POST_GETTER")![]>
        ${snippet}


    }

<#-- setter -->
<#if varDef.isSetterJavaDocExist()>
${varDef.getSetterJavaDoc()}

<#foreach annotation in varDef.getAnnotation("SETTER")![]>
    ${annotation.getSnippet()}

<#assign methodPrefix = varDef.getSetterMethodPrefix()>
    public void ${methodPrefix}${method}(${varDef.type} ${varDef.name}) <#if varDef.isSetterThrows()> ${varDef.getSetterThrowsSnippet()} {
<#-- custom attribute snippet - pre setter -->
<#if varDef.getCustomSnippet("PRE_SETTER")?has_content>
<#foreach snippet in varDef.getCustomSnippet("PRE_SETTER")![]>
        ${snippet}


<#-- custom attribute snippet - setter -->
<#if varDef.getCustomSnippet("SETTER")?has_content>
<#foreach snippet in varDef.getCustomSnippet("SETTER")![]>
<#if snippet??>
        ${snippet}


<#else>
        this.${varDef.name} = ${varDef.name};

<#-- custom attribute snippet - post setter -->
<#if varDef.getCustomSnippet("POST_SETTER")?has_content>
<#foreach snippet in varDef.getCustomSnippet("POST_SETTER")![]>
        ${snippet}


    }

<#-- fluent -->
<#if fluentAPI>
<#if varDef.isFluentJavaDocExist()>
${varDef.getFluentJavaDoc()}

<#foreach annotation in varDef.getAnnotation("FLUENT")![]>
    ${annotation.getSnippet()}

<#assign fluentMethod = varDef.fluentMethodName>
    public ${classDef.getClassName()} ${fluentMethod}(${varDef.type} ${varDef.name}) {
<#-- custom attribute snippet - pre fluent -->
<#if varDef.getCustomSnippet("PRE_FLUENT")?has_content>
<#foreach snippet in varDef.getCustomSnippet("PRE_FLUENT")>
        ${snippet}
${n}

<#-- custom attribute snippet - fluent -->
<#if varDef.getCustomSnippet("FLUENT")?has_content>
<#foreach snippet in varDef.getCustomSnippet("FLUENT")![]>
        ${snippet}

<#else>
        this.${varDef.name} = ${varDef.name};
        return this;

    }

<#-- add/remove -->
<#if varDef.getImplementationType()?has_content>
    ${varDef.getHelperMethodSnippet()}

<#-- custom attribute snippet - after method -->
<#if varDef.getCustomSnippet("AFTER_METHOD")?has_content>
<#foreach snippet in varDef.getCustomSnippet("AFTER_METHOD")![]>
    ${snippet}
${n}


<#-- custom class snippet - after method -->
<#if classDef.getCustomSnippet("AFTER_METHOD")?has_content>
<#foreach snippet in classDef.getCustomSnippet("AFTER_METHOD")![]>
    ${snippet}
${n}

<#-- hashcode, equals and toString method -->
<#if classDef.getEqualsMethod()??>
    @Override
    public boolean equals(Object obj) {
        ${classDef.getEqualsMethod().getSnippet()}
    }
${n}
<#if classDef.getHashcodeMethod()??>
    @Override
    public int hashCode() {
        ${classDef.getHashcodeMethod().getSnippet()}
    }
${n}
<#if classDef.getToStringMethod()??>
    @Override
    public String toString() {
        return ${classDef.getToStringMethod().getSnippet()};
    }
${n}
<#-- custom class snippet - default -->
<#if classDef.getCustomSnippet("DEFAULT")?has_content>
<#foreach snippet in classDef.getCustomSnippet("DEFAULT")![]>
    ${snippet}
${n}

}
<#-- custom class snippet - after class -->
<#if classDef.getCustomSnippet("AFTER_CLASS")?has_content>
<#foreach snippet in classDef.getCustomSnippet("AFTER_CLASS")![]>
${snippet} 
${n}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy