public interface RecordHelper extends DataFormatProvider
Entity DTO to/from its actual domain object
representation.BasicPersistenceModule},
MapStructurePersistenceModule},
AdornedTargetListPersistenceModule}| Modifier and Type | Method and Description |
|---|---|
EntityResult |
add(PersistencePackage persistencePackage,
boolean includeRealEntityObject) |
Serializable |
createPopulatedInstance(Serializable instance,
Entity entity,
Map<String,FieldMetadata> unfilteredProperties,
Boolean setId)
Delegates to the overloaded method with validateUnsubmittedProperties set to true.
|
Serializable |
createPopulatedInstance(Serializable instance,
Entity entity,
Map<String,FieldMetadata> mergedProperties,
Boolean setId,
Boolean validateUnsubmittedProperties)
Populates a Hibernate entity instance based on the values from entity (the DTO representation of
instance) and the metadata from mergedProperties.
|
PersistenceModule |
getCompatibleModule(OperationType operationType) |
FieldManager |
getFieldManager() |
List<FilterMapping> |
getFilterMappings(PersistencePerspective persistencePerspective,
CriteriaTransferObject cto,
String ceilingEntityFullyQualifiedClassname,
Map<String,FieldMetadata> mergedProperties) |
List<FilterMapping> |
getFilterMappings(PersistencePerspective persistencePerspective,
CriteriaTransferObject cto,
String ceilingEntityFullyQualifiedClassname,
Map<String,FieldMetadata> mergedUnfilteredProperties,
RestrictionFactory customRestrictionFactory) |
Serializable |
getMaxValue(String ceilingEntity,
List<FilterMapping> filterMappings,
String maxField) |
List<Serializable> |
getPersistentRecords(String ceilingEntity,
List<FilterMapping> filterMappings,
Integer firstResult,
Integer maxResults) |
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) |
String |
getStringValueFromGetter(Serializable instance,
String propertyName)
Returns a string representation of the field on the given instance specified by the property name.
|
Integer |
getTotalRecords(String ceilingEntity,
List<FilterMapping> filterMappings) |
EntityResult |
update(PersistencePackage persistencePackage,
boolean includeRealEntityObject) |
boolean |
validate(Entity entity,
Serializable populatedInstance,
Map<String,FieldMetadata> mergedProperties)
Delegates to the overloaded method with validateUnsubmittedProperties set to true.
|
boolean |
validate(Entity entity,
Serializable populatedInstance,
Map<String,FieldMetadata> mergedProperties,
boolean validateUnsubmittedProperties)
Validates the
Entity based on the validators associated with each property |
formatValue, getDecimalFormatter, getSimpleDateFormatterList<FilterMapping> getFilterMappings(PersistencePerspective persistencePerspective, CriteriaTransferObject cto, String ceilingEntityFullyQualifiedClassname, Map<String,FieldMetadata> mergedProperties)
List<FilterMapping> getFilterMappings(PersistencePerspective persistencePerspective, CriteriaTransferObject cto, String ceilingEntityFullyQualifiedClassname, Map<String,FieldMetadata> mergedUnfilteredProperties, RestrictionFactory customRestrictionFactory)
Entity[] getRecords(Map<String,FieldMetadata> primaryMergedProperties, List<? extends Serializable> records, Map<String,FieldMetadata> alternateMergedProperties, String pathToTargetObject)
Entity[] getRecords(Map<String,FieldMetadata> primaryMergedProperties, List<? extends Serializable> records)
Entity[] getRecords(Class<?> ceilingEntityClass, PersistencePerspective persistencePerspective, List<? extends Serializable> records)
Entity getRecord(Map<String,FieldMetadata> primaryMergedProperties, Serializable record, Map<String,FieldMetadata> alternateMergedProperties, String pathToTargetObject)
Entity getRecord(Class<?> ceilingEntityClass, PersistencePerspective persistencePerspective, Serializable record)
Serializable createPopulatedInstance(Serializable instance, Entity entity, Map<String,FieldMetadata> mergedProperties, Boolean setId, Boolean validateUnsubmittedProperties) throws ValidationException
Populates a Hibernate entity instance based on the values from entity (the DTO representation of instance) and the metadata from mergedProperties.
While populating instance, validation is also performed using the EntityValidatorService. If this
validation fails, then the instance is left unchanged and a ValidationExcpetion is thrown. In the common
case, this exception bubbles up to the DynamicRemoteService which catches the exception and communicates
appropriately to the invoker
instance - entity - mergedProperties - setId - validateUnsubmittedProperties - if set to true, will ignore validation for properties that weren't submitted
along with the entityValidationException - if after populating instance via the values in entity then
EntityValidatorService#validate(Entity, Serializable, Map) returns falseEntityValidatorService}Serializable createPopulatedInstance(Serializable instance, Entity entity, Map<String,FieldMetadata> unfilteredProperties, Boolean setId) throws ValidationException
Object getPrimaryKey(Entity entity, Map<String,FieldMetadata> mergedProperties)
Map<String,FieldMetadata> getSimpleMergedProperties(String entityName, PersistencePerspective persistencePerspective)
FieldManager getFieldManager()
PersistenceModule getCompatibleModule(OperationType operationType)
boolean validate(Entity entity, Serializable populatedInstance, Map<String,FieldMetadata> mergedProperties, boolean validateUnsubmittedProperties)
Entity based on the validators associated with each propertyentity - the instance that is attempted to be saved from. Implementers should set Entity.isValidationFailure()
accordingly as a result of the validationpopulatedInstance - mergedProperties - TODOvalidateUnsubmittedProperties - if set to true, will ignore validation for properties that weren't submitted
along with the entityEntity.isValidationFailure()
after invoking this methodboolean validate(Entity entity, Serializable populatedInstance, Map<String,FieldMetadata> mergedProperties)
Integer getTotalRecords(String ceilingEntity, List<FilterMapping> filterMappings)
Serializable getMaxValue(String ceilingEntity, List<FilterMapping> filterMappings, String maxField)
List<Serializable> getPersistentRecords(String ceilingEntity, List<FilterMapping> filterMappings, Integer firstResult, Integer maxResults)
EntityResult update(PersistencePackage persistencePackage, boolean includeRealEntityObject) throws ServiceException
ServiceExceptionEntityResult add(PersistencePackage persistencePackage, boolean includeRealEntityObject) throws ServiceException
ServiceExceptionString getStringValueFromGetter(Serializable instance, String propertyName) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
instance - propertyName - IllegalAccessExceptionInvocationTargetExceptionNoSuchMethodExceptionCopyright © 2015. All rights reserved.