Package org.openbravo.service.datasource
Class DataSourceProperty
- java.lang.Object
-
- org.openbravo.service.datasource.DataSourceProperty
-
public class DataSourceProperty extends Object
A representation of theDatasourceField
which can be read from the DataSourceField table or created on the basis of an existingProperty
from the in-memory model. DataSourceProperties are passed into the data source template to generate the data source representation. This class provides static factory methods for different ways of creating it.- Author:
- mtaal
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DataSourceProperty.RefListEntry
-
Constructor Summary
Constructors Constructor Description DataSourceProperty()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DataSourceProperty
createFromDataSourceField(DatasourceField dsField)
Create a DataSourceProperty using aDatasourceField
to initialize it.static DataSourceProperty
createFromProperty(Property property)
Create a DataSourceProperty using a model property.static List<DataSourceProperty.RefListEntry>
createValueMap(Set<String> allowedValues, String referenceId)
Set<String>
getAllowedValues()
static Set<String>
getAllowedValues(Reference reference)
Gets a Set of allowed values for a List referenceint
getFieldLength()
String
getName()
Class<?>
getPrimitiveObjectType()
Entity
getTargetEntity()
String
getType()
UIDefinition
getUIDefinition()
List<DataSourceProperty.RefListEntry>
getValueMapContent()
boolean
isAdditional()
boolean
isAuditInfo()
boolean
isBoolean()
boolean
isId()
boolean
isMandatory()
boolean
isNumericType()
boolean
isPrimitive()
boolean
isUpdatable()
void
setAdditional(boolean additional)
void
setAllowedValues(Set<String> allowedValues)
void
setAuditInfo(boolean auditInfo)
void
setBoolean(boolean isBoolean)
void
setFieldLength(int fieldLength)
void
setId(boolean id)
void
setMandatory(boolean mandatory)
void
setName(String name)
void
setNumericType(boolean numericType)
void
setPrimitive(boolean primitive)
void
setPrimitiveObjectType(Class<?> primitiveObjectType)
void
setTargetEntity(Entity targetEntity)
void
setUIDefinition(UIDefinition uiDefinition)
void
setUpdatable(boolean updatable)
void
setValueMap(List<DataSourceProperty.RefListEntry> valueMap)
-
-
-
Method Detail
-
createFromProperty
public static DataSourceProperty createFromProperty(Property property)
Create a DataSourceProperty using a model property.- Parameters:
property
- the property to use to initialize the data source property- Returns:
- a new DataSourceProperty instance
-
createFromDataSourceField
public static DataSourceProperty createFromDataSourceField(DatasourceField dsField)
Create a DataSourceProperty using aDatasourceField
to initialize it.- Parameters:
dsField
- the data source field used to initialize the new data source property- Returns:
- a new DataSourceProperty instance
-
getAllowedValues
public static Set<String> getAllowedValues(Reference reference)
Gets a Set of allowed values for a List reference- Parameters:
reference
- List reference
-
createValueMap
public static List<DataSourceProperty.RefListEntry> createValueMap(Set<String> allowedValues, String referenceId)
-
getType
public String getType()
-
getName
public String getName()
-
setName
public void setName(String name)
-
isId
public boolean isId()
-
setId
public void setId(boolean id)
-
isMandatory
public boolean isMandatory()
-
setMandatory
public void setMandatory(boolean mandatory)
-
isAuditInfo
public boolean isAuditInfo()
-
setAuditInfo
public void setAuditInfo(boolean auditInfo)
-
isUpdatable
public boolean isUpdatable()
-
setUpdatable
public void setUpdatable(boolean updatable)
-
isBoolean
public boolean isBoolean()
-
setBoolean
public void setBoolean(boolean isBoolean)
-
isPrimitive
public boolean isPrimitive()
-
setPrimitive
public void setPrimitive(boolean primitive)
-
getFieldLength
public int getFieldLength()
-
setFieldLength
public void setFieldLength(int fieldLength)
-
getPrimitiveObjectType
public Class<?> getPrimitiveObjectType()
-
setPrimitiveObjectType
public void setPrimitiveObjectType(Class<?> primitiveObjectType)
-
getTargetEntity
public Entity getTargetEntity()
-
setTargetEntity
public void setTargetEntity(Entity targetEntity)
-
isNumericType
public boolean isNumericType()
-
setNumericType
public void setNumericType(boolean numericType)
-
getValueMapContent
public List<DataSourceProperty.RefListEntry> getValueMapContent()
-
setValueMap
public void setValueMap(List<DataSourceProperty.RefListEntry> valueMap)
-
getUIDefinition
public UIDefinition getUIDefinition()
-
setUIDefinition
public void setUIDefinition(UIDefinition uiDefinition)
-
isAdditional
public boolean isAdditional()
-
setAdditional
public void setAdditional(boolean additional)
-
-