| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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 ScaffoldDomainvalidator - The validator to set.public void setIdentityPropertyName(String identityPropertyName)
ScaffoldDomain
setIdentityPropertyName in interface ScaffoldDomainprotected void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
sessionFactory - The sessionFactory to set.public List list()
list in interface ScaffoldDomainpublic List list(int max)
list in interface ScaffoldDomainmax - The maximum number of instances to return
public List list(int max,
                 int offset)
list in interface ScaffoldDomainmax - The maximum number to returnoffset - The offset position
public List list(int max,
                 int offset,
                 String sort)
list in interface ScaffoldDomainmax - 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 ScaffoldDomainmax - 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 ScaffoldDomainby - The property to find byq - The query criteria
public List find(String by,
                 Object q,
                 int max)
find in interface ScaffoldDomainmax - The maximum number of results to returnfor description
public List find(String by,
                 Object q,
                 int max,
                 int offset)
find in interface ScaffoldDomainmax - The maximum number of results to returnoffset - The offset positionfor description
public List find(String[] by,
                 Object[] q)
ScaffoldDomain
find in interface ScaffoldDomainby - The properties to find byq - The query values
public List find(String[] by,
                 Object[] q,
                 int max)
find in interface ScaffoldDomainmax - The maximum number of results to returnfor description
public List find(String[] by,
                 Object[] q,
                 int max,
                 int offset)
find in interface ScaffoldDomainmax - The maximum number of results to returnoffset - The offset positionfor description
public boolean save(Object domainObject,
                    ScaffoldCallback callback)
ScaffoldDomain
save in interface ScaffoldDomaindomainObject - 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 ScaffoldDomainpublic Object delete(Serializable id)
delete in interface ScaffoldDomainpublic void setPersistentClass(Class persistentClass)
ScaffoldDomain
setPersistentClass in interface ScaffoldDomainpersistentClass - The persistent classpublic Object get(Serializable id)
ScaffoldDomain
get in interface ScaffoldDomainpublic String getPluralName()
ScaffoldDomain
getPluralName in interface ScaffoldDomainpublic Class getPersistentClass()
ScaffoldDomain
getPersistentClass in interface ScaffoldDomainpublic String getSingularName()
ScaffoldDomain
getSingularName in interface ScaffoldDomainpublic String getIdentityPropertyName()
getIdentityPropertyName in interface ScaffoldDomainpublic String getName()
getName in interface ScaffoldDomainpublic Object newInstance()
newInstance in interface ScaffoldDomainpublic void setSessionFactory(Object sessionFactory)
ScaffoldDomain
setSessionFactory in interface ScaffoldDomainsessionFactory - The session factory to use| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||