Class PrimitiveReferenceHandler

    • Constructor Detail

      • PrimitiveReferenceHandler

        public PrimitiveReferenceHandler()
    • Method Detail

      • getPrimitiveReferences

        public List<Property> getPrimitiveReferences​(Entity entity)
        Parameters:
        entity - the Entity for which to get the primitive reference properties
        Returns:
        list of properties of the entity which are primitive references isPrimitiveReference(Property)).
      • isPrimitiveReference

        public boolean isPrimitiveReference​(Property property)
        Code which handles so-called primitive references, These are references which are modeled as primitive types and which do not have a foreign key constraint defined in the database. The reference is defined using 2 columns: one holding the id, the other holding the table
        Parameters:
        property - the property to check if it is a primitive reference
        Returns:
        true if this property is a primitive reference, false otherwise
      • hasObjectPrimitiveReference

        public boolean hasObjectPrimitiveReference​(BaseOBObject obObject)
        Returns true if the passed object has so-called primitive references ( isPrimitiveReference(Property)).
        Parameters:
        obObject - the object having a primitive reference property (or not)
        Returns:
        true if this entity holds a primitive reference
      • getPrimitiveReferencedEntity

        public Entity getPrimitiveReferencedEntity​(BaseOBObject obObject,
                                                   Property property)
        In case of a primitive reference (isPrimitiveReference(Property)) then this method returns the Entity to which the property value refers. This method may only be called if the primitive reference is unequal to null.
        Parameters:
        obObject - the object refering to an instance of an Entity
        property - the primitive reference property
        Returns:
        the Entity to which the property value refers, can not be null
        Throws:
        OBException - if no Entity can be found