Class IssuePersistentProperties
java.lang.Object
com.onenetwork.platform.data.model.IssuePersistentProperties
public class IssuePersistentProperties
extends java.lang.Object
Utility class to support additional properties on the
Issue
object
which can be stored in the database.-
Constructor Summary
Constructors Constructor Description IssuePersistentProperties()
-
Method Summary
Modifier and Type Method Description java.lang.Object
get(java.lang.String columnName)
Returns the property with the given columnName.java.util.Map<java.lang.String,java.lang.Object>
getColumnar()
org.json.JSONObject
getNonColumnar()
boolean
isEmpty()
void
set(java.lang.String columnName, java.lang.Object value)
Stores the given value as a JSON property in the JSON_PARAMS column.void
set(java.lang.String columnName, java.lang.Object value, boolean columnar)
When columnar is false, the given value will be stored in the JSON_PARAMS column as a property on a JSON object.
-
Constructor Details
-
IssuePersistentProperties
public IssuePersistentProperties()
-
-
Method Details
-
set
public void set(java.lang.String columnName, java.lang.Object value, boolean columnar)When columnar is false, the given value will be stored in the JSON_PARAMS column as a property on a JSON object. Otherwise, it puts the value in a column of the same name on the relevant issue table. For columnar data, provide the data in java.sql format, i.e. primitives, Strings, and objects like java.sql.Timestamp. If you provide true for columnar and no such column exists, a runtime exception will be thrown- Parameters:
columnName
- for columnar, name of column to store data in - for non-columnar, JSONObject property namevalue
- value to be stored in the given propertyisColumnar
- true for columnar, false for JSONObject property
-
set
public void set(java.lang.String columnName, java.lang.Object value)Stores the given value as a JSON property in the JSON_PARAMS column. (Like callingset(String, Object, boolean)
with false for columnar.- Parameters:
columnName
- JSONObject property namevalue
- value to be stored in the given property
-
get
public java.lang.Object get(java.lang.String columnName)Returns the property with the given columnName. Since issues are never fetched (only written), this will only be useful in the context of the same workflow which sets the values.- Parameters:
columnName
- for columnar, name of column - for non-columnar, JSONObject property name
-
isEmpty
public boolean isEmpty()- Returns:
- true iff at least one property (of any kind) is set
-
getNonColumnar
public org.json.JSONObject getNonColumnar()- Returns:
- the nonColumnar JSON object (mutable)
-
getColumnar
public java.util.Map<java.lang.String,java.lang.Object> getColumnar()- Returns:
- the map of columnar values (mutable)
-