📄 idao.tvm
字号:
package ${package};
import java.io.Serializable;
public interface ${class.DAOInterfaceName} {
#if ($class.ParentRoot.Id)
public ${class.AbsoluteValueObjectSignatureClassName} get(${class.ParentRoot.Id.Property.AbsoluteSignatureClassName} key)#if ($exceptionClass) throws ${exceptionClass}#end;
public ${class.AbsoluteValueObjectSignatureClassName} load(${class.ParentRoot.Id.Property.AbsoluteSignatureClassName} key)#if ($exceptionClass) throws ${exceptionClass}#end;
#end
#foreach ($prop in $class.AllProperties)
#if ($prop.FinderMethod)
public java.util.List<${class.AbsoluteValueObjectSignatureClassName}> $prop.FinderMethod (${prop.AbsoluteSignatureClassName} ${prop.VarName});
#end
#end
public java.util.List<${class.AbsoluteValueObjectSignatureClassName}> findAll ();
#if ($class.ParentRoot.Id)
/**
* Persist the given transient instance, first assigning a generated identifier. (Or using the current value
* of the identifier property if the assigned generator is used.)
* @param ${class.VarName} a transient instance of a persistent class
* @return the class identifier
*/
public ${class.ParentRoot.Id.Property.ObjectClass} save(${class.AbsoluteValueObjectSignatureClassName} ${class.VarName})#if ($exceptionClass) throws ${exceptionClass}#end;
#end
/**
* Either save() or update() the given instance, depending upon the value of its identifier property. By default
* the instance is always saved. This behaviour may be adjusted by specifying an unsaved-value attribute of the
* identifier property mapping.
* @param ${class.VarName} a transient instance containing new or updated state
*/
public void saveOrUpdate(${class.AbsoluteValueObjectSignatureClassName} ${class.VarName})#if ($exceptionClass) throws ${exceptionClass}#end;
/**
* Update the persistent state associated with the given identifier. An exception is thrown if there is a persistent
* instance with the same identifier in the current session.
* @param ${class.VarName} a transient instance containing updated state
*/
public void update(${class.AbsoluteValueObjectSignatureClassName} ${class.VarName})#if ($exceptionClass) throws ${exceptionClass}#end;
#if ($class.ParentRoot.Id && $class.ParentRoot.Id.hasExternalClass())
/**
* Remove a persistent instance from the datastore. The argument may be an instance associated with the receiving
* Session or a transient instance with an identifier associated with existing persistent state.
* @param id the instance ID to be removed
*/
public void delete(${class.ParentRoot.Id.Property.AbsoluteClassName} id)#if ($exceptionClass) throws ${exceptionClass}#end;
#end
/**
* Remove a persistent instance from the datastore. The argument may be an instance associated with the receiving
* Session or a transient instance with an identifier associated with existing persistent state.
* @param ${class.VarName} the instance to be removed
*/
public void delete(${class.AbsoluteValueObjectSignatureClassName} ${class.VarName})#if ($exceptionClass) throws ${exceptionClass}#end;
${snippet.DAOCustomInterfaceContents}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -