Class GenericValue

    • Field Detail

    • Constructor Detail

      • GenericValue

        public GenericValue()
    • Method Detail

      • create

        public static GenericValue create​(Delegator delegator,
                                          ModelEntity modelEntity,
                                          java.util.Map<java.lang.String,​? extends java.lang.Object> fields)
        Creates new GenericValue from existing Map
      • create

        public static GenericValue create​(Delegator delegator,
                                          ModelEntity modelEntity,
                                          java.lang.Object singlePkValue)
        Creates new GenericValue from existing Map
      • create

        public static GenericValue create​(GenericValue value)
        Creates new GenericValue from existing GenericValue
      • create

        public static GenericValue create​(GenericPK primaryKey)
        Creates new GenericValue from existing GenericValue
      • getRelated

        @Deprecated
        public java.util.List<GenericValue> getRelated​(java.lang.String relationName)
                                                throws GenericEntityException
        Get the named Related Entity for the GenericValue from the persistent store
        Parameters:
        relationName - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
        Returns:
        List of GenericValue instances as specified in the relation definition
        Throws:
        GenericEntityException
      • getRelated

        @Deprecated
        public java.util.List<GenericValue> getRelated​(java.lang.String relationName,
                                                       java.util.List<java.lang.String> orderBy)
                                                throws GenericEntityException
        Get the named Related Entity for the GenericValue from the persistent store
        Parameters:
        relationName - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
        orderBy - The fields of the named entity to order the query by; may be null; optionally add a " ASC" for ascending or " DESC" for descending
        Returns:
        List of GenericValue instances as specified in the relation definition
        Throws:
        GenericEntityException
      • getRelated

        @Deprecated
        public java.util.List<GenericValue> getRelated​(java.lang.String relationName,
                                                       java.util.Map<java.lang.String,​? extends java.lang.Object> byAndFields,
                                                       java.util.List<java.lang.String> orderBy)
                                                throws GenericEntityException
        Get the named Related Entity for the GenericValue from the persistent store
        Parameters:
        relationName - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
        byAndFields - the fields that must equal in order to keep; may be null
        orderBy - The fields of the named entity to order the query by; may be null; optionally add a " ASC" for ascending or " DESC" for descending
        Returns:
        List of GenericValue instances as specified in the relation definition
        Throws:
        GenericEntityException
      • getRelated

        public java.util.List<GenericValue> getRelated​(java.lang.String relationName,
                                                       java.util.Map<java.lang.String,​? extends java.lang.Object> byAndFields,
                                                       java.util.List<java.lang.String> orderBy,
                                                       boolean useCache)
                                                throws GenericEntityException
        Get the named Related Entity for the GenericValue from the persistent store
        Parameters:
        relationName - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
        byAndFields - the fields that must equal in order to keep; may be null
        orderBy - The fields of the named entity to order the query by; may be null; optionally add a " ASC" for ascending or " DESC" for descending
        useCache - Whether to cache the results
        Returns:
        List of GenericValue instances as specified in the relation definition
        Throws:
        GenericEntityException
      • getRelatedMulti

        public java.util.List<GenericValue> getRelatedMulti​(java.lang.String relationNameOne,
                                                            java.lang.String relationNameTwo,
                                                            java.util.List<java.lang.String> orderBy)
                                                     throws GenericEntityException
        Get the named Related Entity for the GenericValue from the persistent store across another Relation. Helps to get related Values in a multi-to-multi relationship.
        Parameters:
        relationNameOne - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file, for first relation
        relationNameTwo - String containing the relation name for second relation
        orderBy - The fields of the named entity to order the query by; may be null; optionally add a " ASC" for ascending or " DESC" for descending
        Returns:
        List of GenericValue instances as specified in the relation definition
        Throws:
        GenericEntityException
      • getRelatedMulti

        public java.util.List<GenericValue> getRelatedMulti​(java.lang.String relationNameOne,
                                                            java.lang.String relationNameTwo)
                                                     throws GenericEntityException
        Get the named Related Entity for the GenericValue from the persistent store across another Relation. Helps to get related Values in a multi-to-multi relationship.
        Parameters:
        relationNameOne - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file, for first relation
        relationNameTwo - String containing the relation name for second relation
        Returns:
        List of GenericValue instances as specified in the relation definition
        Throws:
        GenericEntityException
      • getRelatedOne

        @Deprecated
        public GenericValue getRelatedOne​(java.lang.String relationName)
                                   throws GenericEntityException
        Get the named Related Entity for the GenericValue from the persistent store
        Parameters:
        relationName - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
        Returns:
        List of GenericValue instances as specified in the relation definition
        Throws:
        GenericEntityException
      • getRelatedOne

        public GenericValue getRelatedOne​(java.lang.String relationName,
                                          boolean useCache)
                                   throws GenericEntityException
        Get the named Related Entity for the GenericValue from the persistent store
        Parameters:
        relationName - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
        useCache - Whether to cache the results
        Returns:
        The single related GenericValue instance
        Throws:
        GenericEntityException
      • removeRelated

        public void removeRelated​(java.lang.String relationName)
                           throws GenericEntityException
        Remove the named Related Entity for the GenericValue from the persistent store
        Parameters:
        relationName - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
        Throws:
        GenericEntityException
      • getRelatedDummyPK

        public GenericPK getRelatedDummyPK​(java.lang.String relationName)
                                    throws GenericEntityException
        Get a dummy primary key for the named Related Entity for the GenericValue
        Parameters:
        relationName - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
        Returns:
        GenericPK containing a possibly incomplete PrimaryKey object representing the related entity or entities
        Throws:
        GenericEntityException
      • getRelatedDummyPK

        public GenericPK getRelatedDummyPK​(java.lang.String relationName,
                                           java.util.Map<java.lang.String,​? extends java.lang.Object> byAndFields)
                                    throws GenericEntityException
        Get a dummy primary key for the named Related Entity for the GenericValue
        Parameters:
        relationName - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
        byAndFields - the fields that must equal in order to keep; may be null
        Returns:
        GenericPK containing a possibly incomplete PrimaryKey object representing the related entity or entities
        Throws:
        GenericEntityException
      • hashCode

        public int hashCode()
        Description copied from class: GenericEntity
        Creates a hashCode for the entity, using the default String hashCode and Map hashCode, overrides the default hashCode
        Specified by:
        hashCode in interface java.util.Map<java.lang.String,​java.lang.Object>
        Overrides:
        hashCode in class GenericEntity
        Returns:
        Hashcode corresponding to this entity
      • equals

        public boolean equals​(java.lang.Object obj)
        Description copied from class: GenericEntity
        Determines the equality of two GenericEntity objects, overrides the default equals
        Specified by:
        equals in interface java.util.Map<java.lang.String,​java.lang.Object>
        Overrides:
        equals in class GenericEntity
        Parameters:
        obj - The object (GenericEntity) to compare this two
        Returns:
        boolean stating if the two objects are equal
      • clone

        public java.lang.Object clone()
        Clones this GenericValue, this is a shallow clone and uses the default shallow HashMap clone
        Overrides:
        clone in class GenericEntity
        Returns:
        Object that is a clone of this GenericValue
      • getStackTraceAsString

        public static java.lang.String getStackTraceAsString()