|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openmrs.api.db.hibernate.HibernateFormDAO
public class HibernateFormDAO
Hibernate specific Form related functions This class should not be used directly. All calls
should go through the FormService methods.
FormDAO,
FormService| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
log
|
| Constructor Summary | |
|---|---|
HibernateFormDAO()
|
|
| Method Summary | |
|---|---|
void |
deleteField(Field field)
Deletes a field from the database. |
void |
deleteFieldType(FieldType fieldType)
Delete the given field type from the database |
void |
deleteForm(Form form)
Delete form from database. |
void |
deleteFormField(FormField formField)
Deletes a FormField from the database. |
Form |
duplicateForm(Form form)
Creates new form from the given Form |
java.util.List<Field> |
getAllFields(boolean includeRetired)
Returns all fields in the database, possibly including retired ones |
java.util.List<FieldType> |
getAllFieldTypes(boolean includeRetired)
Get all field types |
java.util.List<FormField> |
getAllFormFields()
Returns all FormFields in the database |
java.util.List<Form> |
getAllForms(boolean includeRetired)
Returns all forms in the database, possibly including retired ones |
Field |
getField(java.lang.Integer fieldId)
|
FieldAnswer |
getFieldAnswerByUuid(java.lang.String uuid)
|
Field |
getFieldByUuid(java.lang.String uuid)
Auto generated method comment |
java.util.List<Field> |
getFields(java.util.Collection<Form> forms,
java.util.Collection<FieldType> fieldTypes,
java.util.Collection<Concept> concepts,
java.util.Collection<java.lang.String> tableNames,
java.util.Collection<java.lang.String> attributeNames,
java.lang.Boolean selectMultiple,
java.util.Collection<FieldAnswer> containsAllAnswers,
java.util.Collection<FieldAnswer> containsAnyAnswer,
java.lang.Boolean retired)
Returns all fields that match a broad range of (nullable) criteria |
java.util.List<Field> |
getFields(java.lang.String search)
|
java.util.List<Field> |
getFieldsByConcept(Concept concept)
|
FieldType |
getFieldType(java.lang.Integer fieldTypeId)
Get fieldType by internal identifier |
FieldType |
getFieldTypeByUuid(java.lang.String uuid)
Auto generated method comment |
Form |
getForm(java.lang.Integer formId)
Get form by internal form identifier |
Form |
getForm(java.lang.String name,
java.lang.String version)
Get form by exact name and version |
Form |
getFormByUuid(java.lang.String uuid)
Auto generated method comment |
FormField |
getFormField(Form form,
Concept concept,
java.util.Collection<FormField> ignoreFormFields,
boolean force)
|
FormField |
getFormField(java.lang.Integer formFieldId)
|
FormField |
getFormFieldByUuid(java.lang.String uuid)
Auto generated method comment |
java.util.List<FormField> |
getFormFields(Form form)
|
java.util.List<FormField> |
getFormFieldsByField(Field field)
Return a list of FormFields given a Field |
java.util.List<Form> |
getForms(java.lang.String partialName,
java.lang.Boolean published,
java.util.Collection<EncounterType> encounterTypes,
java.lang.Boolean retired,
java.util.Collection<FormField> containingAnyFormField,
java.util.Collection<FormField> containingAllFormFields,
java.util.Collection<Field> fields)
Gets all forms that match all the criteria. |
java.util.List<Form> |
getFormsByName(java.lang.String name)
Gets all forms with the given name, sorted (alphabetically) by descending version |
java.util.List<Form> |
getFormsContainingConcept(Concept c)
Get all forms that contain the given Concept as one of their fields. |
Field |
saveField(Field field)
|
FieldType |
saveFieldType(FieldType fieldType)
Save the given field type to the database |
Form |
saveForm(Form form)
Returns the form object originally passed in, which will have been persisted. |
FormField |
saveFormField(FormField formField)
|
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Set session factory |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log log
| Constructor Detail |
|---|
public HibernateFormDAO()
| Method Detail |
|---|
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
sessionFactory -
public Form saveForm(Form form)
throws DAOException
saveForm in interface FormDAODAOExceptionFormService.createForm(org.openmrs.Form)
public Form duplicateForm(Form form)
throws DAOException
FormDAOForm
duplicateForm in interface FormDAOform - Form to duplicate
Form
DAOExceptionFormService.duplicateForm(org.openmrs.Form)
public void deleteForm(Form form)
throws DAOException
FormDAOForms
should be retired and not deleted altogether (since many foreign key
constraints depend on forms, deleting a form would require deleting all traces, and any
historical trail would be lost). This method only clears form roles and attempts to delete
the form record. If the form has been included in any other parts of the database (through a
foreign key), the attempt to delete the form will violate foreign key constraints and fail.
deleteForm in interface FormDAOform - Form to delete
DAOExceptionFormService.deleteForm(org.openmrs.Form)
public Form getForm(java.lang.Integer formId)
throws DAOException
FormDAO
getForm in interface FormDAOformId - Integer internal identifier for requested Form
Form
DAOExceptionFormService.getForm(java.lang.Integer)
public java.util.List<FormField> getFormFields(Form form)
throws DAOException
DAOExceptionFormService.getFormFields(Form)
public java.util.List<Field> getFields(java.lang.String search)
throws DAOException
getFields in interface FormDAOsearch - String phrase to search for
DAOExceptionFormDAO.getFields(java.lang.String)
public java.util.List<Field> getFieldsByConcept(Concept concept)
throws DAOException
DAOExceptionFormService.getFieldsByConcept(org.openmrs.Concept)
public Field getField(java.lang.Integer fieldId)
throws DAOException
getField in interface FormDAODAOExceptionFormService.getField(java.lang.Integer),
FormDAO.getField(java.lang.Integer)
public java.util.List<Field> getAllFields(boolean includeRetired)
throws DAOException
FormDAO
getAllFields in interface FormDAOincludeRetired - whether or not to return retired fields
DAOExceptionFormService.getAllFields(boolean),
FormDAO.getAllFields(boolean)
public FieldType getFieldType(java.lang.Integer fieldTypeId)
throws DAOException
FormDAO
getFieldType in interface FormDAOfieldTypeId - Internal Integer identifier of FieldType
DAOExceptionFormService.getFieldType(java.lang.Integer),
FormDAO.getFieldType(java.lang.Integer)
public java.util.List<FieldType> getAllFieldTypes(boolean includeRetired)
throws DAOException
FormDAO
getAllFieldTypes in interface FormDAOincludeRetired - boolean - include retired field types as well?
DAOExceptionFormService.getFieldTypes(),
FormDAO.getAllFieldTypes(boolean)
public FormField getFormField(java.lang.Integer formFieldId)
throws DAOException
getFormField in interface FormDAODAOExceptionFormService.getFormField(java.lang.Integer),
FormDAO.getFormField(java.lang.Integer)
public FormField getFormField(Form form,
Concept concept,
java.util.Collection<FormField> ignoreFormFields,
boolean force)
throws DAOException
getFormField in interface FormDAODAOExceptionFormService.getFormField(org.openmrs.Form, org.openmrs.Concept,
java.util.Collection, boolean),
FormDAO.getFormField(org.openmrs.Form, org.openmrs.Concept,
java.util.Collection, boolean)
public java.util.List<Form> getAllForms(boolean includeRetired)
throws DAOException
FormDAO
getAllForms in interface FormDAOincludeRetired - boolean - include retired forms?
public java.util.List<Form> getFormsContainingConcept(Concept c)
throws DAOException
FormDAOConcept as one of their fields. (Includes
retired forms.)
getFormsContainingConcept in interface FormDAOc - the Concept to search through form fields for
DAOExceptionFormDAO.getFormsContainingConcept(org.openmrs.Concept)
public Field saveField(Field field)
throws DAOException
saveField in interface FormDAODAOExceptionFormService.saveField(org.openmrs.Field),
FormDAO.saveField(org.openmrs.Field)
public void deleteField(Field field)
throws DAOException
FormDAOThis will fail if any other entities reference this field via a foreign key
deleteField in interface FormDAOfield - the Field to delete
DAOExceptionFormService.deleteField(org.openmrs.Field),
FormDAO.deleteField(org.openmrs.Field)
public FormField saveFormField(FormField formField)
throws DAOException
saveFormField in interface FormDAODAOExceptionFormService.createFormField(org.openmrs.FormField)
public void deleteFormField(FormField formField)
throws DAOException
FormDAO
deleteFormField in interface FormDAOformField - the FormField to delete
DAOExceptionFormService.deleteFormField(org.openmrs.FormField),
FormDAO.deleteFormField(org.openmrs.FormField)
public java.util.List<FormField> getAllFormFields()
throws DAOException
FormDAO
getAllFormFields in interface FormDAODAOExceptionFormDAO.getAllFormFields()
public java.util.List<Field> getFields(java.util.Collection<Form> forms,
java.util.Collection<FieldType> fieldTypes,
java.util.Collection<Concept> concepts,
java.util.Collection<java.lang.String> tableNames,
java.util.Collection<java.lang.String> attributeNames,
java.lang.Boolean selectMultiple,
java.util.Collection<FieldAnswer> containsAllAnswers,
java.util.Collection<FieldAnswer> containsAnyAnswer,
java.lang.Boolean retired)
throws DAOException
FormDAO
getFields in interface FormDAOforms - Collection of Form to which the requested Fields must
belongfieldTypes - Collection of FieldType of which the requested
fields must beconcepts - Collection of Concepts which the fields must point
totableNames - Collection of TableNames which the fields must point toattributeNames - Collection of String attribute names which the
fields must point toselectMultiple - Boolean value that matching fields must have for
selectMultiplecontainsAllAnswers - Collection of FieldAnswers, all of which
a matching field must contain (not yet implemented)containsAnyAnswer - Collection of FieldAnswers, any one of
which a matching field must contain (not yet implemented)retired - Boolean retired status that fields must match
- Returns:
- All Fields that match the criteria
- Throws:
DAOException- See Also:
FormDAO.getFields(java.util.Collection, java.util.Collection,
java.util.Collection, java.util.Collection, java.util.Collection, java.lang.Boolean,
java.util.Collection, java.util.Collection, java.lang.Boolean)
public Form getForm(java.lang.String name,
java.lang.String version)
throws DAOException
FormDAO
getForm in interface FormDAOname - the name of the form to getversion - the version of the form to get
DAOExceptionFormDAO.getForm(java.lang.String, java.lang.String)
public java.util.List<Form> getForms(java.lang.String partialName,
java.lang.Boolean published,
java.util.Collection<EncounterType> encounterTypes,
java.lang.Boolean retired,
java.util.Collection<FormField> containingAnyFormField,
java.util.Collection<FormField> containingAllFormFields,
java.util.Collection<Field> fields)
throws DAOException
FormDAO
getForms in interface FormDAOpartialName - String of partial name of form to search onpublished - boolean - is the form published?encounterTypes - Collection of EncounterTypes that the form must representretired - boolean - is the form retired?containingAnyFormField - Collection of FormFields, any one of which must be
contained in the formcontainingAllFormFields - Collection of FormFields, all of which must be
contained in the formfields - Collection of Fields that the form must contain
DAOExceptionFormDAO.getForms(java.lang.String, java.lang.Boolean,
java.util.Collection, java.lang.Boolean, java.util.Collection, java.util.Collection,
java.util.Collection)public Field getFieldByUuid(java.lang.String uuid)
FormDAO
getFieldByUuid in interface FormDAOFormDAO.getFieldByUuid(java.lang.String)public FieldAnswer getFieldAnswerByUuid(java.lang.String uuid)
getFieldAnswerByUuid in interface FormDAOpublic FieldType getFieldTypeByUuid(java.lang.String uuid)
FormDAO
getFieldTypeByUuid in interface FormDAOFormDAO.getFieldTypeByUuid(java.lang.String)public Form getFormByUuid(java.lang.String uuid)
FormDAO
getFormByUuid in interface FormDAOFormDAO.getFormByUuid(java.lang.String)public FormField getFormFieldByUuid(java.lang.String uuid)
FormDAO
getFormFieldByUuid in interface FormDAOFormDAO.getFormFieldByUuid(java.lang.String)
public java.util.List<Form> getFormsByName(java.lang.String name)
throws DAOException
FormDAO
getFormsByName in interface FormDAOname - String name of the forms to get
DAOExceptionFormDAO.getFormsByName(java.lang.String)
public void deleteFieldType(FieldType fieldType)
throws DAOException
FormDAO
deleteFieldType in interface FormDAOfieldType - FieldType to delete
DAOExceptionFormDAO.deleteFieldType(org.openmrs.FieldType)
public FieldType saveFieldType(FieldType fieldType)
throws DAOException
FormDAO
saveFieldType in interface FormDAOfieldType - FieldType to save to the database
DAOExceptionFormDAO.saveFieldType(org.openmrs.FieldType)public java.util.List<FormField> getFormFieldsByField(Field field)
FormDAO
getFormFieldsByField in interface FormDAOorg.openmrs.api.db.FormDAO#getFormFieldByField(org.openmrs.Field)
|
OpenMRS-1.7.x | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||