Class EntityService

java.lang.Object
com.avoka.fc.core.service.entity.EntityService

public class EntityService extends Object
Provides Management entities service.
  • Constructor Details

    • EntityService

      public EntityService()
  • Method Details

    • getEntity

      public BaseEntity getEntity(Class dataClass, Object id)
      Return the entity for the given class and primary key. This method will apply data security filtering against the currently logged in administrator.
      Parameters:
      dataClass - the entity class
      id - the entity primary key
      Returns:
      the entity for the given class and primary key
    • getEntities

      public List getEntities(Class dataClass)
    • getEntities

      public List getEntities(Class dataClass, List clients)
    • getEntities

      public List getEntities(Class dataClass, String sortField)
    • getEntities

      public List getEntities(Class dataClass, String sortField, List clients)
    • getChildEntities

      public List getChildEntities(Class childClass, String parentProperty, String childSortProperty, String id)
    • canAssignUniqueValue

      public boolean canAssignUniqueValue(String name, String value, BaseEntity existingDataObject, String groupByProperty, Object groupByValue)
      Return true if the given unique value can be assigned to the given DataObject, false otherwise.
      Parameters:
      name - the name to check if it is unique
      existingDataObject - the dataObject to assign the name to
      Returns:
      true if the unique name can be assigned to the DataObject, false otherwise
    • save

      public void save(BaseEntity baseEntity)
      Save the given entityReturn true if the entity was synchronized.
      Parameters:
      baseEntity - the entity to save
    • deleteEntity

      public boolean deleteEntity(Class dataClass, String id)
      Delete the given entity.
      Parameters:
      dataClass - the data class of the entity to delete
      id - the entity primary key
      Returns:
      true if the entity was deleted