java.lang.Object
de.fraunhofer.iosb.ilt.frostclient.model.Entity
All Implemented Interfaces:
ComplexValue<Entity>

public class Entity extends Object implements ComplexValue<Entity>
The Entity model element.
  • Constructor Details

  • Method Details

    • getPrimaryKey

      public final PrimaryKey getPrimaryKey()
      Get the primary key definition of the (EntityType of the) Entity. This is a shorthand for getEntityType().getPrimaryKey();
      Returns:
      The primary key definition of the Entity.
    • getPrimaryKeyValues

      public final Object[] getPrimaryKeyValues()
      Key the values of the primary key fields for this Entity.
      Returns:
      the primary key values.
    • primaryKeyFullySet

      public boolean primaryKeyFullySet()
    • setPrimaryKeyValues

      public final Entity setPrimaryKeyValues(Object... values)
    • getSelfLink

      public String getSelfLink()
    • setSelfLink

      public Entity setSelfLink(String selfLink)
    • getEntityType

      public EntityType getEntityType()
    • setEntityType

      public Entity setEntityType(EntityType entityType)
    • isSetProperty

      public boolean isSetProperty(Property property)
    • getProperty

      public <P> P getProperty(Property<P> property)
      Description copied from interface: ComplexValue
      Get the value of the given property.
      Specified by:
      getProperty in interface ComplexValue<Entity>
      Type Parameters:
      P - The type of the property and value.
      Parameters:
      property - The property to get the value of.
      Returns:
      the value of the requested property.
    • getProperty

      public Entity getProperty(NavigationPropertyEntity property) throws ServiceFailureException
      Throws:
      ServiceFailureException
    • getProperty

      public Entity getProperty(NavigationPropertyEntity npe, boolean autoLoad) throws ServiceFailureException
      Throws:
      ServiceFailureException
    • getProperty

      public <P> P getProperty(Property<P> property, boolean autoLoad)
    • getProperty

      public Object getProperty(String name)
      Description copied from interface: ComplexValue
      Get the custom property with the given name. Only valid for ComplexTypes that are classed as openType, returns null for non-openTypes.
      Specified by:
      getProperty in interface ComplexValue<Entity>
      Parameters:
      name - The name of the custom property to fetch.
      Returns:
      The value of the custom property.
    • setProperty

      public Entity setProperty(String name, Object value)
      Description copied from interface: ComplexValue
      Set the custom property with the given name to the given value. Only valid for ComplexTypes that are classed as openType.
      Specified by:
      setProperty in interface ComplexValue<Entity>
      Parameters:
      name - The name of the custom property to set.
      value - The value of the custom property to set.
      Returns:
      this.
    • setProperty

      public <P> Entity setProperty(Property<P> property, P value)
      Description copied from interface: ComplexValue
      Set the given property to the given value.
      Specified by:
      setProperty in interface ComplexValue<Entity>
      Type Parameters:
      P - The type of the property.
      Parameters:
      property - The property to set.
      value - The value to set the property to.
      Returns:
      this.
    • unsetProperty

      public Entity unsetProperty(Property property)
    • addNavigationEntity

      public Entity addNavigationEntity(NavigationPropertyEntitySet navProperty, Entity linkedEntity)
    • addNavigationEntity

      public Entity addNavigationEntity(NavigationPropertyEntitySet navProperty, List<Entity> linkedEntities)
    • addNavigationEntity

      public Entity addNavigationEntity(NavigationPropertyEntitySet navProperty, Entity... linkedEntities)
    • hasService

      public boolean hasService()
      Check if the entity is associated with a service or not.
      Returns:
      true if the entity is associated with a service.
    • getService

      public SensorThingsService getService()
    • setService

      public void setService(SensorThingsService service)
    • withOnlyPk

      public Entity withOnlyPk()
      Creates a copy of the entity, with only the Primary Key field(s) set. Useful when creating a new entity that links to this entity.
      Returns:
      a copy with only the Primary Key fields set.
    • query

      public Query query(NavigationPropertyEntitySet navigationPropery)
    • dao

      public Dao dao(NavigationPropertyEntitySet navigationPropery)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object