@Service(value="blAdminEntityService") public class AdminEntityServiceImpl extends Object implements AdminEntityService
Modifier and Type | Field and Description |
---|---|
protected DynamicDaoHelper |
dynamicDaoHelper |
protected javax.persistence.EntityManager |
em |
protected EntityConfiguration |
entityConfiguration |
protected PersistencePackageFactory |
persistencePackageFactory |
protected DynamicEntityService |
service |
Constructor and Description |
---|
AdminEntityServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected Entity |
add(PersistencePackageRequest request) |
Entity |
addEntity(EntityForm entityForm,
String[] customCriteria)
Persists the given entity
|
Entity |
addSubCollectionEntity(EntityForm entityForm,
ClassMetadata mainMetadata,
Property field,
Entity parentEntity)
Adds an item into the specified collection
|
protected DynamicResultSet |
fetch(PersistencePackageRequest request) |
Entity |
getAdvancedCollectionRecord(ClassMetadata containingClassMetadata,
Entity containingEntity,
Property collectionProperty,
String collectionItemId)
Gets an Entity representing a specific collection item
|
ClassMetadata |
getClassMetadata(PersistencePackageRequest request)
Returns class metadata for the given request object
|
String |
getContextSpecificRelationshipId(ClassMetadata cmd,
Entity entity,
String propertyName)
Returns the appropriate id to use for the given entity/metadata and prefix when dealing with collections.
|
protected CriteriaTransferObject |
getDefaultCto() |
String |
getIdProperty(ClassMetadata cmd)
Returns the name of the property in this ClassMetadata that has field type set to
SupportedFieldType.ID |
protected List<Property> |
getPropertiesFromEntityForm(EntityForm entityForm) |
Entity |
getRecord(PersistencePackageRequest request,
String id,
ClassMetadata cmd,
boolean isCollectionRequest)
Returns a specific record for the given request and primary key id/property
|
DynamicResultSet |
getRecords(PersistencePackageRequest request)
Returns the DynamicResultSet containing the total records for the query and the currently fetched Entity[]
|
Map<String,DynamicResultSet> |
getRecordsForAllSubCollections(PersistencePackageRequest ppr,
Entity containingEntity)
Returns all records for all subcollections of the specified request and its primary key
|
DynamicResultSet |
getRecordsForCollection(ClassMetadata containingClassMetadata,
Entity containingEntity,
Property collectionProperty,
FilterAndSortCriteria[] fascs,
Integer startIndex,
Integer maxIndex)
Returns the DynamicResultSet representing the records that belong to the specified collectionProperty for the
given containingClass and the primary key for the containingClass
|
DynamicResultSet |
getRecordsForCollection(ClassMetadata containingClassMetadata,
Entity containingEntity,
Property collectionProperty,
FilterAndSortCriteria[] fascs,
Integer startIndex,
Integer maxIndex,
String idValueOverride)
The same as the other getRecordsForCollection method, except that this one expects allow the caller to explicitly
set the id value that will be used in the fetch instead of delegating to
#getContextSpecificRelationshipId() |
protected PersistencePackageRequest |
getRequestForEntityForm(EntityForm entityForm,
String[] customCriteria) |
protected DynamicResultSet |
inspect(PersistencePackageRequest request) |
protected void |
remove(PersistencePackageRequest request) |
void |
removeEntity(EntityForm entityForm,
String[] customCriteria)
Removes the given entity
|
void |
removeSubCollectionEntity(ClassMetadata mainMetadata,
Property field,
Entity parentEntity,
String itemId,
String priorKey)
Removes the given item from the specified collection.
|
protected Entity |
update(PersistencePackageRequest request) |
Entity |
updateEntity(EntityForm entityForm,
String[] customCriteria)
Updates the given entity
|
Entity |
updateSubCollectionEntity(EntityForm entityForm,
ClassMetadata mainMetadata,
Property field,
Entity parentEntity,
String collectionItemId)
Updates the specified collection item
|
protected DynamicEntityService service
protected PersistencePackageFactory persistencePackageFactory
protected javax.persistence.EntityManager em
protected EntityConfiguration entityConfiguration
protected DynamicDaoHelper dynamicDaoHelper
public ClassMetadata getClassMetadata(PersistencePackageRequest request) throws ServiceException
AdminEntityService
getClassMetadata
in interface AdminEntityService
ServiceException
public DynamicResultSet getRecords(PersistencePackageRequest request) throws ServiceException
AdminEntityService
getRecords
in interface AdminEntityService
ServiceException
public Entity getRecord(PersistencePackageRequest request, String id, ClassMetadata cmd, boolean isCollectionRequest) throws ServiceException
AdminEntityService
getRecord
in interface AdminEntityService
isCollectionRequest
- whether or not this record request was initiated from a collection on a parent entityServiceException
public Entity addEntity(EntityForm entityForm, String[] customCriteria) throws ServiceException
AdminEntityService
addEntity
in interface AdminEntityService
ServiceException
public Entity updateEntity(EntityForm entityForm, String[] customCriteria) throws ServiceException
AdminEntityService
updateEntity
in interface AdminEntityService
ServiceException
public void removeEntity(EntityForm entityForm, String[] customCriteria) throws ServiceException
AdminEntityService
removeEntity
in interface AdminEntityService
ServiceException
protected List<Property> getPropertiesFromEntityForm(EntityForm entityForm)
protected PersistencePackageRequest getRequestForEntityForm(EntityForm entityForm, String[] customCriteria)
public Entity getAdvancedCollectionRecord(ClassMetadata containingClassMetadata, Entity containingEntity, Property collectionProperty, String collectionItemId) throws ServiceException
AdminEntityService
getAdvancedCollectionRecord
in interface AdminEntityService
ServiceException
public DynamicResultSet getRecordsForCollection(ClassMetadata containingClassMetadata, Entity containingEntity, Property collectionProperty, FilterAndSortCriteria[] fascs, Integer startIndex, Integer maxIndex) throws ServiceException
AdminEntityService
getRecordsForCollection
in interface AdminEntityService
ServiceException
public DynamicResultSet getRecordsForCollection(ClassMetadata containingClassMetadata, Entity containingEntity, Property collectionProperty, FilterAndSortCriteria[] fascs, Integer startIndex, Integer maxIndex, String idValueOverride) throws ServiceException
AdminEntityService
#getContextSpecificRelationshipId()
getRecordsForCollection
in interface AdminEntityService
ServiceException
public Map<String,DynamicResultSet> getRecordsForAllSubCollections(PersistencePackageRequest ppr, Entity containingEntity) throws ServiceException
AdminEntityService
getRecordsForAllSubCollections
in interface AdminEntityService
ServiceException
#getRecordsForCollection(ClassMetadata, String, Property)
public Entity addSubCollectionEntity(EntityForm entityForm, ClassMetadata mainMetadata, Property field, Entity parentEntity) throws ServiceException, ClassNotFoundException
AdminEntityService
addSubCollectionEntity
in interface AdminEntityService
ServiceException
ClassNotFoundException
public Entity updateSubCollectionEntity(EntityForm entityForm, ClassMetadata mainMetadata, Property field, Entity parentEntity, String collectionItemId) throws ServiceException, ClassNotFoundException
AdminEntityService
updateSubCollectionEntity
in interface AdminEntityService
ServiceException
ClassNotFoundException
public void removeSubCollectionEntity(ClassMetadata mainMetadata, Property field, Entity parentEntity, String itemId, String priorKey) throws ServiceException
AdminEntityService
removeSubCollectionEntity
in interface AdminEntityService
priorKey
- - only needed for Map type collectionsServiceException
public String getContextSpecificRelationshipId(ClassMetadata cmd, Entity entity, String propertyName)
AdminEntityService
getContextSpecificRelationshipId
in interface AdminEntityService
public String getIdProperty(ClassMetadata cmd) throws ServiceException
AdminEntityService
SupportedFieldType.ID
getIdProperty
in interface AdminEntityService
ServiceException
protected Entity add(PersistencePackageRequest request) throws ServiceException
ServiceException
protected Entity update(PersistencePackageRequest request) throws ServiceException
ServiceException
protected DynamicResultSet inspect(PersistencePackageRequest request) throws ServiceException
ServiceException
protected void remove(PersistencePackageRequest request) throws ServiceException
ServiceException
protected DynamicResultSet fetch(PersistencePackageRequest request) throws ServiceException
ServiceException
protected CriteriaTransferObject getDefaultCto()
Copyright © 2014. All rights reserved.