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) |
String |
getIdPropertyName(String entityClass)
For the fully qualified entity class name, find the primary key property name.
|
Serializable |
getMaxValue(String ceilingEntity,
List<FilterMapping> filterMappings,
String maxField) |
List<Serializable> |
getPersistentRecords(FetchRequest fetchRequest)
Retrieve a paged list of persistent entity instances given some basic metadata and restrictions.
|
List<Serializable> |
getPersistentRecords(String ceilingEntity,
List<FilterMapping> filterMappings,
Integer firstResult,
Integer maxResults)
Deprecated.
use
getPersistentRecords(FetchRequest) instead |
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(FetchExtractionRequest fetchExtractionRequest)
Based on retrieved persistent entities and entity metadata, construct data transfer object instances to represent these records
to the caller.
|
Entity[] |
getRecords(Map<String,FieldMetadata> primaryMergedProperties,
List<? extends Serializable> records)
Deprecated.
use
getRecords(FetchExtractionRequest) instead. |
Entity[] |
getRecords(Map<String,FieldMetadata> primaryMergedProperties,
List<? extends Serializable> records,
Map<String,FieldMetadata> alternateMergedProperties,
String pathToTargetObject)
Deprecated.
use
getRecords(FetchExtractionRequest) instead |
Entity[] |
getRecords(Map<String,FieldMetadata> primaryMergedProperties,
List<? extends Serializable> records,
Map<String,FieldMetadata> alternateMergedProperties,
String pathToTargetObject,
String[] customCriteria)
Deprecated.
use
getRecords(FetchExtractionRequest) instead |
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(FetchRequest fetchRequest)
Retrieve a total count of persistent entities given some basic metadata and restrictions
|
Integer |
getTotalRecords(String ceilingEntity,
List<FilterMapping> filterMappings)
Deprecated.
use
getTotalRecords(FetchRequest) instead |
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(FetchExtractionRequest fetchExtractionRequest)
fetchExtractionRequest - @Deprecated Entity[] getRecords(Map<String,FieldMetadata> primaryMergedProperties, List<? extends Serializable> records, Map<String,FieldMetadata> alternateMergedProperties, String pathToTargetObject, String[] customCriteria)
getRecords(FetchExtractionRequest) insteadprimaryMergedProperties - records - alternateMergedProperties - pathToTargetObject - customCriteria - @Deprecated Entity[] getRecords(Map<String,FieldMetadata> primaryMergedProperties, List<? extends Serializable> records, Map<String,FieldMetadata> alternateMergedProperties, String pathToTargetObject)
getRecords(FetchExtractionRequest) insteadprimaryMergedProperties - records - alternateMergedProperties - pathToTargetObject - @Deprecated Entity[] getRecords(Map<String,FieldMetadata> primaryMergedProperties, List<? extends Serializable> records)
getRecords(FetchExtractionRequest) instead.primaryMergedProperties - 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 ValidationException 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)
String getIdPropertyName(String entityClass)
entityClass - 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 - validateUnsubmittedProperties - 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)
@Deprecated Integer getTotalRecords(String ceilingEntity, List<FilterMapping> filterMappings)
getTotalRecords(FetchRequest) insteadceilingEntity - filterMappings - Integer getTotalRecords(FetchRequest fetchRequest)
fetchRequest - Serializable getMaxValue(String ceilingEntity, List<FilterMapping> filterMappings, String maxField)
@Deprecated List<Serializable> getPersistentRecords(String ceilingEntity, List<FilterMapping> filterMappings, Integer firstResult, Integer maxResults)
getPersistentRecords(FetchRequest) insteadceilingEntity - filterMappings - firstResult - maxResults - List<Serializable> getPersistentRecords(FetchRequest fetchRequest)
fetchRequest - 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 © 2019. All rights reserved.