mplates.1.2.source-code.PojoServiceJSON.ftl Maven / Gradle / Ivy
<#assign object = doc.object>
package ${object.@package}.service;
import org.jetbrains.annotations.NotNull;
import ${object.@package}.service.base.${object.@name}ServiceJSONBase;
import redora.service.ServiceBase;
import redora.exceptions.ConnectException;
/**
* Service layer for JSON database access concerning the ${object.@name} object.
* Read-only JSON access skips object serialization making it very fast. For modifying
* objects we still fall back to ${object.@name}Service and object serialization because
* business rules checks need the pojo's.
* Redora actually implements everything in ${object.@name}ServiceJSONBase and ${object.@name}ServiceJSON
* extends it. You can add extra services yourself in this class. Usage:
*
* ${object.@name}ServiceJSON service ServiceFactory.${object.@name?uncap_first}ServiceJSON();
* service.doStuff();
* ServiceFactory.close(service);
*
* @author Redora (www.redora.net)
*/
public class ${object.@name}ServiceJSON extends ${object.@name}ServiceJSONBase {
//Protected to avoid instantiation outside ServiceFactory
protected ${object.@name}ServiceJSON() throws ConnectException {
super();
}
/**
* Instantiate by passing an active service.
* Typically you use this when a transaction is spawned over several objects.
* @param chain Active statement/connection managed by another service.
*/
public ${object.@name}ServiceJSON(@NotNull ServiceBase chain) {
super(chain);
}
}