Package org.apache.ofbiz.entity
Class GenericEntity
- java.lang.Object
-
- org.apache.ofbiz.entity.GenericEntity
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable<GenericEntity>
,java.util.Map<java.lang.String,java.lang.Object>
,LocalizedMap<java.lang.Object>
- Direct Known Subclasses:
GenericEntity.NullGenericEntity
,GenericPK
,GenericValue
public class GenericEntity extends java.lang.Object implements java.util.Map<java.lang.String,java.lang.Object>, LocalizedMap<java.lang.Object>, java.io.Serializable, java.lang.Comparable<GenericEntity>, java.lang.Cloneable
Generic Entity Value Object - Handles persistence for any defined entity.Note that this class extends
Observable
to achieve change notification forObserver
s. Whenever a field changes the name of the field will be passed to thenotifyObservers()
method, and through that to theupdate()
method of eachObserver
.This class is not thread-safe. If an instance of this class is shared between threads, then it should be made immutable by calling the
setImmutable()
method.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
GenericEntity.NULL
static class
GenericEntity.NullField
static class
GenericEntity.NullGenericEntity
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
static GenericEntity
NULL_ENTITY
static GenericEntity.NullField
NULL_FIELD
-
Constructor Summary
Constructors Modifier Constructor Description protected
GenericEntity()
Creates new GenericEntity - Should never be used, prefer the other options.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addObserver(Observer observer)
static int
addToXmlDocument(java.util.Collection<GenericValue> values, org.w3c.dom.Document document)
static int
addToXmlElement(java.util.Collection<GenericValue> values, org.w3c.dom.Document document, org.w3c.dom.Element element)
protected void
assertIsMutable()
boolean
checkFks(boolean insertDummy)
Checks to see if all foreign key records exist in the database.void
clear()
void
clearChanged()
java.lang.Object
clone()
Clones this GenericEntity, this is a shallow clone and uses the default shallow HashMap cloneint
compareTo(GenericEntity that)
Compares this GenericEntity to the passed objectprotected int
compareToFields(GenericEntity that, java.lang.String name)
boolean
containsKey(java.lang.Object key)
boolean
containsPrimaryKey()
Returns true if the entity contains all of the primary key fields.boolean
containsPrimaryKey(boolean requireValue)
boolean
containsValue(java.lang.Object value)
static GenericEntity
createGenericEntity(Delegator delegator, ModelEntity modelEntity, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
Creates new GenericEntity from existing Mapstatic GenericEntity
createGenericEntity(GenericEntity value)
Copy Factory Method: Creates new GenericEntity from existing GenericEntitystatic GenericEntity
createGenericEntity(ModelEntity modelEntity)
Creates new GenericEntityjava.lang.Object
dangerousGetNoCheckButFast(ModelField modelField)
void
dangerousSetNoCheckButFast(ModelField modelField, java.lang.Object value)
void
deleteObserver(Observer observer)
void
deleteObservers()
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>>
entrySet()
boolean
equals(java.lang.Object obj)
Determines the equality of two GenericEntity objects, overrides the default equalsjava.lang.Object
get(java.lang.Object key)
java.lang.Object
get(java.lang.String name)
java.lang.Object
get(java.lang.String name, java.lang.String resource, java.util.Locale locale)
Same as the getResource method that does not take resource name, but instead allows manually specifying the resource name.java.lang.Object
get(java.lang.String name, java.util.Locale locale)
Checks a resource bundle for a value for this field using the entity name, the field name and a composite of the Primary Key field values as a key.java.util.Map<java.lang.String,java.lang.Object>
getAllFields()
Returns key/value pairs of entity fieldsjava.util.Collection<java.lang.String>
getAllKeys()
Returns keys of entity fieldsjava.math.BigDecimal
getBigDecimal(java.lang.String name)
java.lang.Boolean
getBoolean(java.lang.String name)
byte[]
getBytes(java.lang.String name)
java.sql.Date
getDate(java.lang.String name)
Delegator
getDelegator()
Get the GenericDelegator instance that created this value object and that is responsible for it.java.lang.Double
getDouble(java.lang.String name)
TimeDuration
getDuration(java.lang.String name)
Returns the specified field as aTimeDuration
instance.java.lang.String
getEntityName()
java.util.Map<java.lang.String,java.lang.Object>
getFields(java.util.Collection<java.lang.String> keysofFields)
Used by clients to specify exactly the fields they are interested injava.lang.Float
getFloat(java.lang.String name)
java.lang.Integer
getInteger(java.lang.String name)
boolean
getIsFromEntitySync()
java.lang.Long
getLong(java.lang.String name)
ModelEntity
getModelEntity()
java.lang.Object
getOriginalDbValue(java.lang.String name)
java.lang.String
getPkShortValueString()
GenericPK
getPrimaryKey()
java.lang.String
getString(java.lang.String name)
java.sql.Time
getTime(java.lang.String name)
java.sql.Timestamp
getTimestamp(java.lang.String name)
boolean
hasChanged()
int
hashCode()
Creates a hashCode for the entity, using the default String hashCode and Map hashCode, overrides the default hashCodeprotected void
init(Delegator delegator, ModelEntity modelEntity, java.lang.Object singlePkValue)
Creates new GenericEntity from existing Mapprotected void
init(Delegator delegator, ModelEntity modelEntity, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
Creates new GenericEntity from existing Mapprotected void
init(GenericEntity value)
Copy Constructor: Creates new GenericEntity from existing GenericEntityprotected void
init(ModelEntity modelEntity)
Creates new GenericEntityboolean
isEmpty()
boolean
isModified()
Deprecated.Use hasChanged()boolean
isMutable()
boolean
isPrimaryKey()
Returns true if the entity contains all of the primary key fields, but NO others.boolean
isPrimaryKey(boolean requireValue)
java.util.Set<java.lang.String>
keySet()
boolean
lockEnabled()
Used to indicate if locking is enabled for this entitystatic org.w3c.dom.Document
makeXmlDocument(java.util.Collection<GenericValue> values)
org.w3c.dom.Element
makeXmlElement(org.w3c.dom.Document document)
Makes an XML Element object with an attribute for each field of the entityorg.w3c.dom.Element
makeXmlElement(org.w3c.dom.Document document, java.lang.String prefix)
Makes an XML Element object with an attribute for each field of the entityboolean
matches(EntityCondition condition)
boolean
matchesFields(java.util.Map<java.lang.String,? extends java.lang.Object> keyValuePairs)
void
notifyObservers()
void
notifyObservers(java.lang.Object arg)
boolean
originalDbValuesAvailable()
java.lang.Object
put(java.lang.String key, java.lang.Object value)
void
putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> map)
void
refreshFromValue(GenericEntity newValue)
java.lang.Object
remove(java.lang.Object key)
void
removedFromDatasource()
Flags this object as being removed from the data source.void
reset()
void
set(java.lang.String name, java.lang.Object value)
Sets the named field to the passed value, even if the value is nulljava.lang.Object
set(java.lang.String name, java.lang.Object value, boolean setIfNull)
Sets the named field to the passed value.void
setAllFields(java.util.Map<? extends java.lang.Object,? extends java.lang.Object> fields, boolean setIfEmpty, java.lang.String namePrefix, java.lang.Boolean pks)
Intelligently sets fields on this entity from the Map of fields passed invoid
setBytes(java.lang.String name, byte[] bytes)
Sets a field with an array of bytes, wrapping them automatically for easy use.void
setChanged()
void
setDelegator(Delegator internalDelegator)
Set the GenericDelegator instance that created this value object and that is responsible for it.void
setFields(java.util.Map<? extends java.lang.String,? extends java.lang.Object> keyValuePairs)
Used by clients to update particular fields in the entityvoid
setImmutable()
void
setIsFromEntitySync(boolean isFromEntitySync)
void
setNextSeqId()
void
setNonPKFields(java.util.Map<? extends java.lang.Object,? extends java.lang.Object> fields)
go through the non-pks and for each one see if there is an entry in fields to setvoid
setNonPKFields(java.util.Map<? extends java.lang.Object,? extends java.lang.Object> fields, boolean setIfEmpty)
go through the non-pks and for each one see if there is an entry in fields to setvoid
setPKFields(java.util.Map<? extends java.lang.Object,? extends java.lang.Object> fields)
go through the pks and for each one see if there is an entry in fields to setvoid
setPKFields(java.util.Map<? extends java.lang.Object,? extends java.lang.Object> fields, boolean setIfEmpty)
go through the pks and for each one see if there is an entry in fields to setvoid
setString(java.lang.String name, java.lang.String value)
Sets the named field to the passed value, converting the value from a String to the corrent type usingType.valueOf()
int
size()
void
synchronizedWithDatasource()
Flags this object as being synchronized with the data source.java.lang.String
toString()
Creates a String for the entity, overrides the default toString This method is secure, it will not display encrypted fieldsjava.lang.String
toStringInsecure()
Creates a String for the entity, overrides the default toString This method is NOT secure, it WILL display encrypted fieldsjava.util.Collection<java.lang.Object>
values()
void
writeXmlText(java.io.PrintWriter writer, java.lang.String prefix)
Writes XML text with an attribute or CDATA element for each field of the entity
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
NULL_ENTITY
public static final GenericEntity NULL_ENTITY
-
NULL_FIELD
public static final GenericEntity.NullField NULL_FIELD
-
-
Method Detail
-
createGenericEntity
public static GenericEntity createGenericEntity(ModelEntity modelEntity)
Creates new GenericEntity
-
createGenericEntity
public static GenericEntity createGenericEntity(Delegator delegator, ModelEntity modelEntity, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
Creates new GenericEntity from existing Map
-
createGenericEntity
public static GenericEntity createGenericEntity(GenericEntity value)
Copy Factory Method: Creates new GenericEntity from existing GenericEntity
-
assertIsMutable
protected void assertIsMutable()
-
init
protected void init(ModelEntity modelEntity)
Creates new GenericEntity
-
init
protected void init(Delegator delegator, ModelEntity modelEntity, java.util.Map<java.lang.String,? extends java.lang.Object> fields)
Creates new GenericEntity from existing Map
-
init
protected void init(Delegator delegator, ModelEntity modelEntity, java.lang.Object singlePkValue)
Creates new GenericEntity from existing Map
-
init
protected void init(GenericEntity value)
Copy Constructor: Creates new GenericEntity from existing GenericEntity
-
reset
public void reset()
-
refreshFromValue
public void refreshFromValue(GenericEntity newValue) throws GenericEntityException
- Throws:
GenericEntityException
-
isModified
@Deprecated public boolean isModified()
Deprecated.Use hasChanged()
-
synchronizedWithDatasource
public void synchronizedWithDatasource()
Flags this object as being synchronized with the data source. The entity engine will call this method immediately after populating this object with data from the data source.
-
removedFromDatasource
public void removedFromDatasource()
Flags this object as being removed from the data source. The entity engine will call this method immediately after removing this value from the data source. Once this method is called, the object is immutable.
-
isMutable
public boolean isMutable()
-
setImmutable
public void setImmutable()
-
getIsFromEntitySync
public boolean getIsFromEntitySync()
- Returns:
- Returns the isFromEntitySync.
-
setIsFromEntitySync
public void setIsFromEntitySync(boolean isFromEntitySync)
- Parameters:
isFromEntitySync
- The isFromEntitySync to set.
-
getEntityName
public java.lang.String getEntityName()
-
getModelEntity
public ModelEntity getModelEntity()
-
getDelegator
public Delegator getDelegator()
Get the GenericDelegator instance that created this value object and that is responsible for it.- Returns:
- GenericDelegator object
-
setDelegator
public void setDelegator(Delegator internalDelegator)
Set the GenericDelegator instance that created this value object and that is responsible for it.
-
get
public java.lang.Object get(java.lang.String name)
-
isPrimaryKey
public boolean isPrimaryKey()
Returns true if the entity contains all of the primary key fields, but NO others.
-
isPrimaryKey
public boolean isPrimaryKey(boolean requireValue)
-
containsPrimaryKey
public boolean containsPrimaryKey()
Returns true if the entity contains all of the primary key fields.
-
containsPrimaryKey
public boolean containsPrimaryKey(boolean requireValue)
-
getPkShortValueString
public java.lang.String getPkShortValueString()
-
set
public void set(java.lang.String name, java.lang.Object value)
Sets the named field to the passed value, even if the value is null- Parameters:
name
- The field name to setvalue
- The value to set
-
set
public java.lang.Object set(java.lang.String name, java.lang.Object value, boolean setIfNull)
Sets the named field to the passed value. If value is null, it is only set if the setIfNull parameter is true. This is useful because an update will only set values that are included in the HashMap and will store null values in the HashMap to the datastore. If a value is not in the HashMap, it will be left unmodified in the datastore.- Parameters:
name
- The field name to setvalue
- The value to setsetIfNull
- Specifies whether or not to set the value if it is null
-
dangerousSetNoCheckButFast
public void dangerousSetNoCheckButFast(ModelField modelField, java.lang.Object value)
-
dangerousGetNoCheckButFast
public java.lang.Object dangerousGetNoCheckButFast(ModelField modelField)
-
setString
public void setString(java.lang.String name, java.lang.String value)
Sets the named field to the passed value, converting the value from a String to the corrent type usingType.valueOf()
- Parameters:
name
- The field name to setvalue
- The String value to convert and set
-
setBytes
public void setBytes(java.lang.String name, byte[] bytes)
Sets a field with an array of bytes, wrapping them automatically for easy use.- Parameters:
name
- The field name to setbytes
- The byte array to be wrapped and set
-
setNextSeqId
public void setNextSeqId()
-
getBoolean
public java.lang.Boolean getBoolean(java.lang.String name)
-
getDuration
public TimeDuration getDuration(java.lang.String name)
Returns the specified field as aTimeDuration
instance. The field's Java data type can be eitherString
orNumber
. Invalid Java data types will throwIllegalArgumentException
.- Parameters:
name
- The name of the desired field- Returns:
- A
TimeDuration
instance ornull
-
getString
public java.lang.String getString(java.lang.String name)
-
getTimestamp
public java.sql.Timestamp getTimestamp(java.lang.String name)
-
getTime
public java.sql.Time getTime(java.lang.String name)
-
getDate
public java.sql.Date getDate(java.lang.String name)
-
getInteger
public java.lang.Integer getInteger(java.lang.String name)
-
getLong
public java.lang.Long getLong(java.lang.String name)
-
getFloat
public java.lang.Float getFloat(java.lang.String name)
-
getDouble
public java.lang.Double getDouble(java.lang.String name)
-
getBigDecimal
public java.math.BigDecimal getBigDecimal(java.lang.String name)
-
getBytes
public byte[] getBytes(java.lang.String name)
-
get
public java.lang.Object get(java.lang.String name, java.util.Locale locale)
Checks a resource bundle for a value for this field using the entity name, the field name and a composite of the Primary Key field values as a key. If no value is found in the resource then the field value is returned. Uses the default-resource-name from the entity definition as the resource name. To specify a resource name manually, use the other getResource method. So, the key in the resource bundle (properties file) should be as follows: <entity-name>.<field-name>.<pk-field-value-1>.<pk-field-value-2>...<pk-field-value-n> For example: ProductType.description.FINISHED_GOOD- Specified by:
get
in interfaceLocalizedMap<java.lang.Object>
- Parameters:
name
- The name of the field on the entitylocale
- The locale to use when finding the ResourceBundle, if null uses the default locale for the current instance of Java- Returns:
- If the corresponding resource is found and contains a key as described above, then that property value is returned; otherwise returns the field value
-
get
public java.lang.Object get(java.lang.String name, java.lang.String resource, java.util.Locale locale)
Same as the getResource method that does not take resource name, but instead allows manually specifying the resource name. In general you should use the other method for more consistent naming and use of the corresponding properties files.- Parameters:
name
- The name of the field on the entityresource
- The name of the resource to get the value from; if null defaults to the default-resource-name on the entity definition, if specified therelocale
- The locale to use when finding the ResourceBundle, if null uses the default locale for the current instance of Java- Returns:
- If the specified resource is found and contains a key as described above, then that property value is returned; otherwise returns the field value
-
getPrimaryKey
public GenericPK getPrimaryKey()
-
setPKFields
public void setPKFields(java.util.Map<? extends java.lang.Object,? extends java.lang.Object> fields)
go through the pks and for each one see if there is an entry in fields to set
-
setPKFields
public void setPKFields(java.util.Map<? extends java.lang.Object,? extends java.lang.Object> fields, boolean setIfEmpty)
go through the pks and for each one see if there is an entry in fields to set
-
setNonPKFields
public void setNonPKFields(java.util.Map<? extends java.lang.Object,? extends java.lang.Object> fields)
go through the non-pks and for each one see if there is an entry in fields to set
-
setNonPKFields
public void setNonPKFields(java.util.Map<? extends java.lang.Object,? extends java.lang.Object> fields, boolean setIfEmpty)
go through the non-pks and for each one see if there is an entry in fields to set
-
setAllFields
public void setAllFields(java.util.Map<? extends java.lang.Object,? extends java.lang.Object> fields, boolean setIfEmpty, java.lang.String namePrefix, java.lang.Boolean pks)
Intelligently sets fields on this entity from the Map of fields passed in- Parameters:
fields
- The fields Map to get the values fromsetIfEmpty
- Used to specify whether empty/null values in the field Map should over-write non-empty values in this entitynamePrefix
- If not null or empty will be pre-pended to each field name (upper-casing the first letter of the field name first), and that will be used as the fields Map lookup name instead of the field-namepks
- If null, get all values, if TRUE just get PKs, if FALSE just get non-PKs
-
getAllKeys
public java.util.Collection<java.lang.String> getAllKeys()
Returns keys of entity fields- Returns:
- java.util.Collection
-
getAllFields
public java.util.Map<java.lang.String,java.lang.Object> getAllFields()
Returns key/value pairs of entity fields- Returns:
- java.util.Map
-
getFields
public java.util.Map<java.lang.String,java.lang.Object> getFields(java.util.Collection<java.lang.String> keysofFields)
Used by clients to specify exactly the fields they are interested in- Parameters:
keysofFields
- the name of the fields the client is interested in- Returns:
- java.util.Map
-
setFields
public void setFields(java.util.Map<? extends java.lang.String,? extends java.lang.Object> keyValuePairs)
Used by clients to update particular fields in the entity- Parameters:
keyValuePairs
- java.util.Map
-
matchesFields
public boolean matchesFields(java.util.Map<java.lang.String,? extends java.lang.Object> keyValuePairs)
-
lockEnabled
public boolean lockEnabled()
Used to indicate if locking is enabled for this entity- Returns:
- True if locking is enabled
-
makeXmlDocument
public static org.w3c.dom.Document makeXmlDocument(java.util.Collection<GenericValue> values)
-
addToXmlDocument
public static int addToXmlDocument(java.util.Collection<GenericValue> values, org.w3c.dom.Document document)
-
addToXmlElement
public static int addToXmlElement(java.util.Collection<GenericValue> values, org.w3c.dom.Document document, org.w3c.dom.Element element)
-
makeXmlElement
public org.w3c.dom.Element makeXmlElement(org.w3c.dom.Document document)
Makes an XML Element object with an attribute for each field of the entity- Parameters:
document
- The XML Document that the new Element will be part of- Returns:
- org.w3c.dom.Element object representing this generic entity
-
makeXmlElement
public org.w3c.dom.Element makeXmlElement(org.w3c.dom.Document document, java.lang.String prefix)
Makes an XML Element object with an attribute for each field of the entity- Parameters:
document
- The XML Document that the new Element will be part ofprefix
- A prefix to put in front of the entity name in the tag name- Returns:
- org.w3c.dom.Element object representing this generic entity
-
writeXmlText
public void writeXmlText(java.io.PrintWriter writer, java.lang.String prefix)
Writes XML text with an attribute or CDATA element for each field of the entity- Parameters:
writer
- A PrintWriter to write toprefix
- A prefix to put in front of the entity name in the tag name
-
equals
public boolean equals(java.lang.Object obj)
Determines the equality of two GenericEntity objects, overrides the default equals- Specified by:
equals
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- The object (GenericEntity) to compare this two- Returns:
- boolean stating if the two objects are equal
-
hashCode
public int hashCode()
Creates a hashCode for the entity, using the default String hashCode and Map hashCode, overrides the default hashCode- Specified by:
hashCode
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- Hashcode corresponding to this entity
-
toString
public java.lang.String toString()
Creates a String for the entity, overrides the default toString This method is secure, it will not display encrypted fields- Overrides:
toString
in classjava.lang.Object
- Returns:
- String corresponding to this entity
-
toStringInsecure
public java.lang.String toStringInsecure()
Creates a String for the entity, overrides the default toString This method is NOT secure, it WILL display encrypted fields- Returns:
- String corresponding to this entity
-
compareToFields
protected int compareToFields(GenericEntity that, java.lang.String name)
-
compareTo
public int compareTo(GenericEntity that)
Compares this GenericEntity to the passed object- Specified by:
compareTo
in interfacejava.lang.Comparable<GenericEntity>
- Parameters:
that
- Object to compare this to- Returns:
- int representing the result of the comparison (-1,0, or 1)
-
clone
public java.lang.Object clone()
Clones this GenericEntity, this is a shallow clone and uses the default shallow HashMap clone- Overrides:
clone
in classjava.lang.Object
- Returns:
- Object that is a clone of this GenericEntity
-
remove
public java.lang.Object remove(java.lang.Object key)
- Specified by:
remove
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
- Specified by:
entrySet
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
put
public java.lang.Object put(java.lang.String key, java.lang.Object value)
- Specified by:
put
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
putAll
public void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> map)
- Specified by:
putAll
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
get
public java.lang.Object get(java.lang.Object key)
- Specified by:
get
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
keySet
public java.util.Set<java.lang.String> keySet()
- Specified by:
keySet
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
values
public java.util.Collection<java.lang.Object> values()
- Specified by:
values
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValue
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Map<java.lang.String,java.lang.Object>
-
matches
public boolean matches(EntityCondition condition)
-
addObserver
public void addObserver(Observer observer)
-
clearChanged
public void clearChanged()
-
deleteObserver
public void deleteObserver(Observer observer)
-
deleteObservers
public void deleteObservers()
-
hasChanged
public boolean hasChanged()
-
notifyObservers
public void notifyObservers()
-
notifyObservers
public void notifyObservers(java.lang.Object arg)
-
setChanged
public void setChanged()
-
originalDbValuesAvailable
public boolean originalDbValuesAvailable()
-
getOriginalDbValue
public java.lang.Object getOriginalDbValue(java.lang.String name)
-
checkFks
public boolean checkFks(boolean insertDummy) throws GenericEntityException
Checks to see if all foreign key records exist in the database. Will create a dummy value for those missing when specified.- Parameters:
insertDummy
- Create a dummy record using the provided fields- Returns:
- true if all FKs exist (or when all missing are created)
- Throws:
GenericEntityException
-
-