|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.grails.scaffolding.DefaultScaffoldDomain
public class DefaultScaffoldDomain
The default implementation of a Scaffolding application that uses Hibernate as the persistence mechanism. Provides simple CRUD facilities onto a Hibernate domain model.
Constructor Summary | |
---|---|
DefaultScaffoldDomain(Class persistentClass,
org.hibernate.SessionFactory sessionFactory)
|
Method Summary | |
---|---|
Object |
delete(Serializable id)
|
List |
find(String[] by,
Object[] q)
Finds all the persistent instances for the specified properties and query values |
List |
find(String[] by,
Object[] q,
int max)
|
List |
find(String[] by,
Object[] q,
int max,
int offset)
|
List |
find(String by,
Object q)
Finds all persistent instances for the specified property name and value |
List |
find(String by,
Object q,
int max)
|
List |
find(String by,
Object q,
int max,
int offset)
|
Object |
get(Serializable id)
Retrieves an persistent class instance for the specified id |
String |
getIdentityPropertyName()
|
String |
getName()
|
Class |
getPersistentClass()
Retrieves the scaffolded persistent class |
String |
getPluralName()
Returns the plural name of the domain |
String |
getSingularName()
Returns the singular name of the domain |
List |
list()
|
List |
list(int max)
|
List |
list(int max,
int offset)
|
List |
list(int max,
int offset,
String sort)
|
List |
list(int max,
int offset,
String sort,
String order)
|
Object |
newInstance()
|
boolean |
save(Object domainObject,
ScaffoldCallback callback)
Saves an instance of the persistent class using the specified properties |
void |
setIdentityPropertyName(String identityPropertyName)
Sets the name of the identity property so that type conversion can be performed |
void |
setPersistentClass(Class persistentClass)
Sets the persistent class used by the scaffold domain |
void |
setSessionFactory(Object sessionFactory)
Sets the session factory used by the persistent implementation |
protected void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
|
void |
setValidator(Validator validator)
Sets the validator to use |
boolean |
update(Object domainObject,
ScaffoldCallback callback)
Updates an existing instance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultScaffoldDomain(Class persistentClass, org.hibernate.SessionFactory sessionFactory)
Method Detail |
---|
public void setValidator(Validator validator)
ScaffoldDomain
setValidator
in interface ScaffoldDomain
validator
- The validator to set.public void setIdentityPropertyName(String identityPropertyName)
ScaffoldDomain
setIdentityPropertyName
in interface ScaffoldDomain
protected void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
sessionFactory
- The sessionFactory to set.public List list()
list
in interface ScaffoldDomain
public List list(int max)
list
in interface ScaffoldDomain
max
- The maximum number of instances to return
public List list(int max, int offset)
list
in interface ScaffoldDomain
max
- The maximum number to returnoffset
- The offset position
public List list(int max, int offset, String sort)
list
in interface ScaffoldDomain
max
- The maximum number to return (Set to -1 for no maximum)offset
- The offset position (Set to -1 for no offset)sort
- The property name to sort by
public List list(int max, int offset, String sort, String order)
list
in interface ScaffoldDomain
max
- The maximum number to return (Set to -1 for no maximum)offset
- The offset position (Set to -1 for no offset)sort
- The property name to sort byorder
- either "ASC" for ascending or "DESC" for descending
public List find(String by, Object q)
ScaffoldDomain
find
in interface ScaffoldDomain
by
- The property to find byq
- The query criteria
public List find(String by, Object q, int max)
find
in interface ScaffoldDomain
max
- The maximum number of results to returnfor description
public List find(String by, Object q, int max, int offset)
find
in interface ScaffoldDomain
max
- The maximum number of results to returnoffset
- The offset positionfor description
public List find(String[] by, Object[] q)
ScaffoldDomain
find
in interface ScaffoldDomain
by
- The properties to find byq
- The query values
public List find(String[] by, Object[] q, int max)
find
in interface ScaffoldDomain
max
- The maximum number of results to returnfor description
public List find(String[] by, Object[] q, int max, int offset)
find
in interface ScaffoldDomain
max
- The maximum number of results to returnoffset
- The offset positionfor description
public boolean save(Object domainObject, ScaffoldCallback callback)
ScaffoldDomain
save
in interface ScaffoldDomain
domainObject
- The domain object to savecallback
- Any validation errors that may have occured during saving
public boolean update(Object domainObject, ScaffoldCallback callback)
ScaffoldDomain
update
in interface ScaffoldDomain
public Object delete(Serializable id)
delete
in interface ScaffoldDomain
public void setPersistentClass(Class persistentClass)
ScaffoldDomain
setPersistentClass
in interface ScaffoldDomain
persistentClass
- The persistent classpublic Object get(Serializable id)
ScaffoldDomain
get
in interface ScaffoldDomain
public String getPluralName()
ScaffoldDomain
getPluralName
in interface ScaffoldDomain
public Class getPersistentClass()
ScaffoldDomain
getPersistentClass
in interface ScaffoldDomain
public String getSingularName()
ScaffoldDomain
getSingularName
in interface ScaffoldDomain
public String getIdentityPropertyName()
getIdentityPropertyName
in interface ScaffoldDomain
public String getName()
getName
in interface ScaffoldDomain
public Object newInstance()
newInstance
in interface ScaffoldDomain
public void setSessionFactory(Object sessionFactory)
ScaffoldDomain
setSessionFactory
in interface ScaffoldDomain
sessionFactory
- The session factory to use
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |