templates.pdo.PersistenceImplementation.ftl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tentackle-wizard-maven-plugin Show documentation
Show all versions of tentackle-wizard-maven-plugin Show documentation
Maven Plugin for Tentackle Wizards
package ${persistenceImplPackage};
import ${pdoPackage}.${pdoInterface};
<#if persistencePackage != persistenceImplPackage>
import ${persistencePackage}.${persistenceInterface};
#if>
<#if remoteEnabled == "true">
import ${persistenceImplPackage}.rmi.${pdoInterface}RemoteDelegate;
#if>
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.function.Supplier;
import org.tentackle.common.Binary;
import org.tentackle.common.BMoney;
import org.tentackle.common.DMoney;
import org.tentackle.common.Date;
import org.tentackle.common.Freezable;
import org.tentackle.common.Time;
import org.tentackle.common.Timestamp;
import org.tentackle.common.RemoteMethod;
import org.tentackle.dbms.DbObjectClassVariables;
import org.tentackle.dbms.PreparedStatementWrapper;
import org.tentackle.dbms.ResultSetWrapper;
import org.tentackle.dbms.StatementId;
import org.tentackle.misc.IdentifiableMap;
import org.tentackle.misc.TrackedArrayList;
import org.tentackle.misc.TrackedList;
import org.tentackle.persist.AbstractPersistentObject;
import org.tentackle.persist.PersistentObjectClassVariables;
import org.tentackle.pdo.DomainContext;
import org.tentackle.pdo.PersistentObjectService;
import org.tentackle.pdo.Pdo;
import org.tentackle.session.Persistent;
import org.tentackle.session.PersistenceException;
import org.tentackle.session.Session;
import org.tentackle.sql.Backend;
import org.tentackle.sql.JoinType;
import org.tentackle.validate.ValidationResult;
import org.tentackle.validate.ValidationScope;
import org.tentackle.validate.ValidationUtilities;
/**
* Persistence implementation for ${pdoInterface}.
*/
@PersistentObjectService(${pdoInterface}.class)
<#if pdoInheritance != "NONE">
public class ${persistenceImplementation}, P extends ${persistenceImplementation}>
extends ${superPersistenceImplementation} implements ${persistenceInterface} {
<#else>
public class ${persistenceImplementation} extends ${superPersistenceImplementation}<${pdoInterface}, ${persistenceImplementation}> implements ${persistenceInterface} {
#if>
/** serial version UID. */
private static final long serialVersionUID = -1;
// @wurblet classVariables ClassVariables
// @wurblet columnNames ColumnNames
// @wurblet declare Declare
/**
* Creates a persistent object for a PDO.
*
* @param pdo the persistent domain object
* @param context the domain context
*/
<#if pdoInheritance != "NONE">
public ${persistenceImplementation}(T pdo, DomainContext context) {
<#else>
public ${persistenceImplementation}(${pdoInterface} pdo, DomainContext context) {
#if>
super(pdo, context);
}
/**
* Creates a persistent object for a PDO.
*
* @param pdo the persistent domain object
* @param session the session
*/
<#if pdoInheritance != "NONE">
public ${persistenceImplementation}(T pdo, Session session) {
<#else>
public ${persistenceImplementation}(${pdoInterface} pdo, Session session) {
#if>
super(pdo, session);
}
/**
* Creates a persistent object for a PDO.
*
* @param pdo the persistent domain object
*/
<#if pdoInheritance != "NONE">
public ${persistenceImplementation}(T pdo) {
<#else>
public ${persistenceImplementation}(${pdoInterface} pdo) {
#if>
super(pdo);
}
/**
* Creates a persistent object.
*/
public ${persistenceImplementation}() {
super();
}
// @wurblet methods MethodsImpl
// @wurblet relations PdoRelations
}