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

templates.operation.PersistenceImplementation.ftl Maven / Gradle / Ivy

There is a newer version: 21.16.1.0
Show newest version

package ${persistenceImplPackage};

import ${operationPackage}.${operationInterface};
<#if persistencePackage != persistenceImplPackage>
import ${persistencePackage}.${persistenceInterface};

<#if remoteEnabled == "true">
import ${persistenceImplPackage}.rmi.${operationInterface}RemoteDelegate;


import java.rmi.RemoteException;
import org.tentackle.pdo.DomainContext;
import org.tentackle.pdo.PersistentOperationService;
import org.tentackle.pdo.Operation;
import org.tentackle.session.PersistenceException;
import org.tentackle.session.Session;

/**
 * Persistence implementation for ${operationInterface}.
 */
@PersistentOperationService(${operationInterface}.class)
<#if abstractOperation == "true">
public class ${persistenceImplementation}, P extends ${persistenceImplementation}>
       extends ${superPersistenceImplementation} implements ${persistenceInterface} {
<#else>
public class ${persistenceImplementation} extends ${superPersistenceImplementation}<${operationInterface}, ${persistenceImplementation}> implements ${persistenceInterface} {


  /** serial version UID. */
  private static final long serialVersionUID = -1;

<#if abstractOperation == "true">
  private static final PersistentOperationClassVariables CLASSVARIABLES =
          new PersistentOperationClassVariables(${operationInterface}.class, ${persistenceImplementation}.class);
<#else>
  private static final PersistentOperationClassVariables<${operationInterface}, ${persistenceImplementation}> CLASSVARIABLES =
          new PersistentOperationClassVariables<>(${operationInterface}.class, ${persistenceImplementation}.class);


  /**
   * Creates a persistent object for an operation.
   *
   * @param operation the operation object
   * @param context the domain context
   */
<#if abstractOperation == "true">
  public ${persistenceImplementation}(T operation, DomainContext context) {
<#else>
  public ${persistenceImplementation}(${operationInterface} operation, DomainContext context) {

    super(operation, context);
  }

  /**
   * Creates a persistent object for an operation.
   *
   * @param operation the operation object
   * @param session the session
   */
<#if abstractOperation == "true">
  public ${persistenceImplementation}(T operation, Session session) {
<#else>
  public ${persistenceImplementation}(${operationInterface} operation, Session session) {

    super(operation, session);
  }

  /**
   * Creates a persistent object for an operation.
   *
   * @param operation the operation object
   */
<#if abstractOperation == "true">
  public ${persistenceImplementation}(T operation) {
<#else>
  public ${persistenceImplementation}(${operationInterface} operation) {

    super(operation);
  }

  /**
   * Creates a persistent object.
   */
  public ${persistenceImplementation}() {
    super();
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy