org.broadleafcommerce.openadmin.server.service.persistence.module
Interface RecordHelper

All Known Implementing Classes:
AdornedTargetListPersistenceModule, BasicPersistenceModule, MapStructurePersistenceModule

public interface RecordHelper

Helper interface for serializing/deserializing the generic Entity DTO to/from its actual domain object representation.

Author:
jfischer
See Also:
BasicPersistenceModule}, MapStructurePersistenceModule}, AdornedTargetListPersistenceModule}

Method Summary
 Serializable createPopulatedInstance(Serializable instance, Entity entity, Map<String,FieldMetadata> mergedProperties, Boolean setId)
           
 PersistenceModule getCompatibleModule(OperationType operationType)
           
 com.anasoft.os.daofusion.criteria.PersistentEntityCriteria getCountCriteria(PersistencePackage persistencePackage, com.anasoft.os.daofusion.cto.client.CriteriaTransferObject cto, BaseCtoConverter ctoConverter)
          Returns the count criteria representation that should be used to count the result set.
 BaseCtoConverter getCtoConverter(PersistencePerspective persistencePerspective, com.anasoft.os.daofusion.cto.client.CriteriaTransferObject cto, String ceilingEntityFullyQualifiedClassname, Map<String,FieldMetadata> mergedProperties)
           
 BaseCtoConverter getCtoConverter(PersistencePerspective persistencePerspective, com.anasoft.os.daofusion.cto.client.CriteriaTransferObject cto, String ceilingEntityFullyQualifiedClassname, Map<String,FieldMetadata> mergedProperties, FilterCriterionProviders criterionProviders)
           
 DecimalFormat getDecimalFormatter()
           
 FieldManager getFieldManager()
           
 Object getPrimaryKey(Entity entity, Map<String,FieldMetadata> mergedProperties)
           
 Entity getRecord(Class<?> ceilingEntityClass, PersistencePerspective persistencePerspective, Serializable record)
           
 Entity getRecord(Map<String,FieldMetadata> primaryMergedProperties, Serializable record, Map<String,FieldMetadata> alternateMergedProperties, String pathToTargetObject)
           
 Entity[] getRecords(Class<?> ceilingEntityClass, PersistencePerspective persistencePerspective, List<? extends Serializable> records)
           
 Entity[] getRecords(Map<String,FieldMetadata> primaryMergedProperties, List<? extends Serializable> records)
           
 Entity[] getRecords(Map<String,FieldMetadata> primaryMergedProperties, List<? extends Serializable> records, Map<String,FieldMetadata> alternateMergedProperties, String pathToTargetObject)
           
 Map<String,FieldMetadata> getSimpleMergedProperties(String entityName, PersistencePerspective persistencePerspective)
           
 int getTotalRecords(PersistencePackage persistencePackage, com.anasoft.os.daofusion.cto.client.CriteriaTransferObject cto, BaseCtoConverter ctoConverter)
           
 boolean validate(Entity entity, Serializable populatedInstance, Map<String,FieldMetadata> mergedProperties)
          Validates the Entity based on the validators associated with each property
 

Method Detail

getCtoConverter

BaseCtoConverter getCtoConverter(PersistencePerspective persistencePerspective,
                                 com.anasoft.os.daofusion.cto.client.CriteriaTransferObject cto,
                                 String ceilingEntityFullyQualifiedClassname,
                                 Map<String,FieldMetadata> mergedProperties)
                                 throws ClassNotFoundException
Throws:
ClassNotFoundException

getCtoConverter

BaseCtoConverter getCtoConverter(PersistencePerspective persistencePerspective,
                                 com.anasoft.os.daofusion.cto.client.CriteriaTransferObject cto,
                                 String ceilingEntityFullyQualifiedClassname,
                                 Map<String,FieldMetadata> mergedProperties,
                                 FilterCriterionProviders criterionProviders)
                                 throws ClassNotFoundException
Throws:
ClassNotFoundException

getRecords

Entity[] getRecords(Map<String,FieldMetadata> primaryMergedProperties,
                    List<? extends Serializable> records,
                    Map<String,FieldMetadata> alternateMergedProperties,
                    String pathToTargetObject)
                    throws ParserConfigurationException,
                           DOMException,
                           IllegalAccessException,
                           InvocationTargetException,
                           NoSuchMethodException,
                           TransformerFactoryConfigurationError,
                           TransformerConfigurationException,
                           IllegalArgumentException,
                           TransformerException,
                           SecurityException,
                           ClassNotFoundException
Throws:
ParserConfigurationException
DOMException
IllegalAccessException
InvocationTargetException
NoSuchMethodException
TransformerFactoryConfigurationError
TransformerConfigurationException
IllegalArgumentException
TransformerException
SecurityException
ClassNotFoundException

getRecords

Entity[] getRecords(Map<String,FieldMetadata> primaryMergedProperties,
                    List<? extends Serializable> records)
                    throws ParserConfigurationException,
                           DOMException,
                           IllegalAccessException,
                           InvocationTargetException,
                           NoSuchMethodException,
                           TransformerFactoryConfigurationError,
                           TransformerConfigurationException,
                           IllegalArgumentException,
                           TransformerException,
                           SecurityException,
                           ClassNotFoundException
Throws:
ParserConfigurationException
DOMException
IllegalAccessException
InvocationTargetException
NoSuchMethodException
TransformerFactoryConfigurationError
TransformerConfigurationException
IllegalArgumentException
TransformerException
SecurityException
ClassNotFoundException

getRecords

Entity[] getRecords(Class<?> ceilingEntityClass,
                    PersistencePerspective persistencePerspective,
                    List<? extends Serializable> records)
                    throws SecurityException,
                           IllegalArgumentException,
                           ClassNotFoundException,
                           NoSuchMethodException,
                           IllegalAccessException,
                           InvocationTargetException,
                           DOMException,
                           TransformerConfigurationException,
                           ParserConfigurationException,
                           TransformerFactoryConfigurationError,
                           TransformerException,
                           NoSuchFieldException
Throws:
SecurityException
IllegalArgumentException
ClassNotFoundException
NoSuchMethodException
IllegalAccessException
InvocationTargetException
DOMException
TransformerConfigurationException
ParserConfigurationException
TransformerFactoryConfigurationError
TransformerException
NoSuchFieldException

getRecord

Entity getRecord(Map<String,FieldMetadata> primaryMergedProperties,
                 Serializable record,
                 Map<String,FieldMetadata> alternateMergedProperties,
                 String pathToTargetObject)
                 throws ParserConfigurationException,
                        DOMException,
                        IllegalAccessException,
                        InvocationTargetException,
                        NoSuchMethodException,
                        TransformerFactoryConfigurationError,
                        TransformerConfigurationException,
                        IllegalArgumentException,
                        TransformerException,
                        SecurityException,
                        ClassNotFoundException
Throws:
ParserConfigurationException
DOMException
IllegalAccessException
InvocationTargetException
NoSuchMethodException
TransformerFactoryConfigurationError
TransformerConfigurationException
IllegalArgumentException
TransformerException
SecurityException
ClassNotFoundException

getRecord

Entity getRecord(Class<?> ceilingEntityClass,
                 PersistencePerspective persistencePerspective,
                 Serializable record)
                 throws SecurityException,
                        IllegalArgumentException,
                        ClassNotFoundException,
                        NoSuchMethodException,
                        IllegalAccessException,
                        InvocationTargetException,
                        DOMException,
                        TransformerConfigurationException,
                        ParserConfigurationException,
                        TransformerFactoryConfigurationError,
                        TransformerException,
                        NoSuchFieldException
Throws:
SecurityException
IllegalArgumentException
ClassNotFoundException
NoSuchMethodException
IllegalAccessException
InvocationTargetException
DOMException
TransformerConfigurationException
ParserConfigurationException
TransformerFactoryConfigurationError
TransformerException
NoSuchFieldException

getTotalRecords

int getTotalRecords(PersistencePackage persistencePackage,
                    com.anasoft.os.daofusion.cto.client.CriteriaTransferObject cto,
                    BaseCtoConverter ctoConverter)
                    throws ClassNotFoundException
Throws:
ClassNotFoundException

getCountCriteria

com.anasoft.os.daofusion.criteria.PersistentEntityCriteria getCountCriteria(PersistencePackage persistencePackage,
                                                                            com.anasoft.os.daofusion.cto.client.CriteriaTransferObject cto,
                                                                            BaseCtoConverter ctoConverter)
                                                                            throws ClassNotFoundException
Returns the count criteria representation that should be used to count the result set. This is an advanced use case and should only be used when you need to have explicit control over the Hibernate criteria that can be created from the result of this method (like if you are using table aliases in the BaseCtoConverter.getFilterCriterionProviders()).

Parameters:
persistencePackage -
cto -
ctoConverter -
Returns:
Throws:
ClassNotFoundException

createPopulatedInstance

Serializable createPopulatedInstance(Serializable instance,
                                     Entity entity,
                                     Map<String,FieldMetadata> mergedProperties,
                                     Boolean setId)
                                     throws IllegalAccessException,
                                            InvocationTargetException,
                                            NoSuchMethodException,
                                            ParseException,
                                            NumberFormatException,
                                            InstantiationException,
                                            ClassNotFoundException
Throws:
IllegalAccessException
InvocationTargetException
NoSuchMethodException
ParseException
NumberFormatException
InstantiationException
ClassNotFoundException

getPrimaryKey

Object getPrimaryKey(Entity entity,
                     Map<String,FieldMetadata> mergedProperties)
                     throws NumberFormatException
Throws:
NumberFormatException

getSimpleMergedProperties

Map<String,FieldMetadata> getSimpleMergedProperties(String entityName,
                                                    PersistencePerspective persistencePerspective)
                                                    throws ClassNotFoundException,
                                                           SecurityException,
                                                           IllegalArgumentException,
                                                           NoSuchMethodException,
                                                           IllegalAccessException,
                                                           InvocationTargetException,
                                                           NoSuchFieldException
Throws:
ClassNotFoundException
SecurityException
IllegalArgumentException
NoSuchMethodException
IllegalAccessException
InvocationTargetException
NoSuchFieldException

getFieldManager

FieldManager getFieldManager()

getCompatibleModule

PersistenceModule getCompatibleModule(OperationType operationType)

getDecimalFormatter

DecimalFormat getDecimalFormatter()

validate

boolean validate(Entity entity,
                 Serializable populatedInstance,
                 Map<String,FieldMetadata> mergedProperties)
                 throws InstantiationException,
                        IllegalAccessException,
                        ClassNotFoundException
Validates the Entity based on the validators associated with each property

Parameters:
entity - the instance that is attempted to be saved from. Implementers should set Entity.isValidationFailure() accordingly as a result of the validation
populatedInstance -
mergedProperties - TODO
Returns:
whether or not the entity passed validation. This yields the same result as calling !Entity.isValidationFailure() after invoking this method
Throws:
InstantiationException
IllegalAccessException
ClassNotFoundException


Copyright © 2013. All Rights Reserved.