templates.domain.OUT.ftl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of autoplsp Show documentation
Show all versions of autoplsp Show documentation
Maven plugin to generate Java classes from StoredProcedure and Functions in Database
<#if header>
/*
* Copyright (C) 2019 Yadickson Soto
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
package ${javaPackage}.domain;
<#list proc.outputParameters as parameter>
<#if parameter.date>
<#assign importDateUtil = 1>
<#if importDateUtil??>
import ${javaPackage}.util.DateUtil;
import java.util.Date;
<#if proc.hasResultSet>
import java.util.List;
<#if lombok>
<#if importDateUtil??>
import lombok.AccessLevel;
import lombok.Getter;
<#if fullConstructor>
import lombok.NoArgsConstructor;
import lombok.Setter;
<#if jsonNonNull>import com.fasterxml.jackson.annotation.JsonInclude;
/**
* Output parameters for <#if proc.function>function<#else>stored procedure.
*
* ${proc.fullName}
*
* @author @GENERATOR.NAME@
* @version @GENERATOR.VERSION@
*/
<#if lombok>
<#if fullConstructor>
@NoArgsConstructor
@Getter
@Setter
<#if jsonNonNull>
@JsonInclude(JsonInclude.Include.NON_NULL)
public final class ${proc.className}OUT<#if serialization> implements java.io.Serializable {
<#if serialization>
/**
* Serialization.
*/
static final long serialVersionUID = 1L;
<#list proc.outputParameters as parameter>
/**
* Output parameter ${parameter.name}.
*
* ${proc.fullName}
*/
<#if lombok && parameter.date>
@Getter(AccessLevel.NONE)
@Setter(AccessLevel.NONE)
private <#if parameter.resultSet || parameter.returnResultSet>List<${parameter.javaTypeName}><#else>${parameter.javaTypeName} ${parameter.fieldName};
<#if !lombok>
/**
* Class constructor ${proc.className}OUT.
*
* ${proc.fullName}
*/
public ${proc.className}OUT() {
}
<#if fullConstructor>
/**
* Class constructor ${proc.className}OUT.
*
* ${proc.fullName}
*
<#list proc.outputParameters as parameter>
* @param p${parameter.propertyName} set value of ${parameter.name}
*/
public ${proc.className}OUT(${'\n'} <#list proc.outputParameters as parameter>final <#if parameter.resultSet || parameter.returnResultSet>List<${parameter.javaTypeName}><#else>${parameter.javaTypeName} p${parameter.propertyName}<#sep>,${'\n'} ${'\n'} ) {
<#list proc.outputParameters as parameter>
set${parameter.propertyName}(p${parameter.propertyName});
}
<#list proc.outputParameters as parameter>
<#if !lombok || parameter.date>
/**
* Getter of ${parameter.name}.
*
* ${proc.fullName}
*
* @return The ${parameter.name} value.
*/
public <#if parameter.resultSet || parameter.returnResultSet>List<${parameter.javaTypeName}><#else>${parameter.javaTypeName} get${parameter.propertyName}() {
return <#if parameter.date>DateUtil.process(${parameter.fieldName}<#if parameter.date>);
}
/**
* Setter of ${parameter.name}.
*
* ${proc.fullName}
*
* @param p${parameter.propertyName} ${parameter.name} to set
*/
public void set${parameter.propertyName}(final <#if parameter.resultSet || parameter.returnResultSet>List<${parameter.javaTypeName}><#else>${parameter.javaTypeName} p${parameter.propertyName}) {
this.${parameter.fieldName} = <#if parameter.date>DateUtil.process(p${parameter.propertyName}<#if parameter.date>);
}
}