Generated_Methods - TransferORM/transfer GitHub Wiki

Generated Methods

These are the methods that are available for a given TransferObject, depending on its configuration.

Notation

The following notation is used in this document.

Notation Description
property An item in italics denotes a XML configuration element, such as id, or property, or manytoone
[@name] The value of that @ named attribute, i.e in this instance it would be the value of the 'name' attribute.


For example, if I had the following in my xml:

<property name="Foo" column="foo" />

The notation of getproperty[@name] would translate to getFoo, as it is the attribute value of name, in the property element which corresponds to property[@name]

Default Methods

TransferObject Name Arguments Returns
Object getClassName none string: The class name of the TransferObject as defined by the config file.
equalsTransfer transfer.com.TransferObject : the TransferObject to check equality with boolean : Whether or not two TransferObjects have the same class, and the same primary key.
sameTransfer transfer.com.TransferObject : the TransferObject to check equality with boolean : Whether or not two TransferObjects are the same object.
clone none transfer.com.TransferObject : A deep clone of this object, that is outside of the Transfer cache.
getIsDirty none boolean : Whether or not the data on this object as changed since it was last committed to the database.
getIsPersisted none boolean : Whether or not this TransferObject has been committed to the database.
getIsProxy none boolean: whether or not this object is a TransferObject Proxy object.
getIsLoaded none boolean: whether or not the underlying object is loaded. For non-Proxy objects, this will always be true. For TransferObject Proxies, it depends on if it has been loaded.
getLoadedObject none transfer.com.TransferObject : For non-Proxy objects, returns this. For TransferObject Proxies, it loads the Proxied object, and returns it.

ID Element

TransferObject Name Arguments Returns
Object setid[@name] id[@type] : The id to set it to, of the type specified by the attribute 'type' void : This will generally only be used by Transfer, however if the ID is set before the TransferObject is create()'ed, it will be inserted with the set ID, overwriting any generation or retrieval of the ID.
getid[@name] none id[@type] : The primary key id, of the type specified by the attribute 'type'.
If the transferObject has yet to inserted into the database it will return the configured null value for its type.

Property Element

TransferObject Name Arguments Returns
Object setproperty[@name]
(If property[@set] == 'true')
property[@type] : The id to set it to, of the type specified by the attribute 'type' void
getproperty[@name]
(If property[@get] == 'true')
none property[@type] : The property to set, of the type specified by the attribute 'type'.
getproperty[@name]IsNull
(If property[@nullable] == 'true')
none boolean : if the property set is equal to the null value specified in configuration.
setproperty[@name]Null
(If property[@nullable] == 'true')
none void : Sets the value to the configured NULL value.

ManyToOne Element

TransferObject Name Arguments Returns
Object setmanytoone[@name] transfer.com.TransferObject : A TransferObject of the class defined in the link[@to] child element. void
getmanytoone[@name] none transfer.com.TransferObject : The TransferObject that is currently set.
removemanytoone[@name] none void : Removes the set ManyToOne Child. This will cause Transfer to use NULL as the value for the foreign key in the database.
hasmanytoone[@name] none boolean : Whether it as a ManyTOOne set or not

OneToMany Element

TransferObject Name Arguments Returns
Object getonetomany[@name]
(if collection[@type] == 'array')
numeric : index of the array to get an item at. transfer.com.TransferObject : A TransferObject of type defined by link[@to]
getonetomany[@name]
(if collection[@type] == 'struct')
key : The unique key the TransferObject is stored under. transfer.com.TransferObject : A TransferObject of type defined by link[@to]
getonetomany[@name]Array
(if collection[@type] == 'array')
none array : a shallow copy of the array of child TransferObjects.
getonetomany[@name]Struct
(if collection[@type] == 'struct')
none struct : a shallow copy of the struct of child TransferObjects.
getonetomany[@name]Iterator none java.util.Iterator : creates a Iterator on a shallow copy of the collection. If collection[@type] == 'array' then the items will be sorted by the specified order, if it has one.
sortonetomany[@name]
(if collection[@type] == 'array')
none void : Performs a software sort on the collection. Usually used after multiple setParentobject[@name]() statements.
containsonetomany[@name] transfer.com.TransferObject : A TransferObject of type defined by link[@to] boolean : whether or not the collection contains this object.
findonetomany[@name] transfer.com.TransferObject : A TransferObject of type defined by link[@to] (if collection[@type] == 'array')
numeric : The index of the object in the array
(if collection[@type] == 'struct')
string : the key the object is stored under.
Child setParentobject[@name] transfer.com.TransferObject : TransferObject of the type of the Object. void : This will add the Child to the Parent.
getParentobject[@name] none transfer.com.TransferObject : The TransferObject that is the parent.
removeParentobject[@name] none void : Sets the object to having no parent, and removes the Child from the Parent. This will cause Transfer to use NULL as the value for the foreign key in the database.
hasParentobject[@name] none boolean : If this TransferObject has a parent or not

ManyToManyElement

TransferObject Name Arguments Returns
Object addmanytomany[@name] transfer.com.TransferObject : The TransferObject of type defined by link[@to] to add to the collection void
getmanytomany[@name]
(if collection[@type] == 'array')
numeric : index of the array to get an item at. transfer.com.TransferObject : A TransferObject of type defined by link[@to]
getmanytomany[@name]
(if collection[@type] == 'struct')
key : The unique key the TransferObject is stored under. transfer.com.TransferObject : A TransferObject of type defined by link[@to]
removemanytomany[@name] transfer.com.TransferObject : A TransferObject of type defined by link[@to] to be removed from the collection. void
clearmanytomany[@name] none void : Removes all children from the collection.
sortmanytomany[@name]
(if collection[@type] == 'array')
none void : Performs a software sort on the collection. Usually used after multiple addcollection@name statements.
getmanytomany[@name]Array
(if collection[@type] == 'array')
none array : a shallow copy of the array of child TransferObjects.
getmanytomany[@name]Struct
(if collection[@type] == 'struct')
none struct : a shallow copy of the struct of child TransferObjects.
getmanytomany[@name]Iterator none java.util.Iterator : creates a Iterator on a shallow copy of the collection. If collection[@type] == 'array' then the items will be sorted by the specified order, if it has one.
containsmanytomany@name transfer.com.TransferObject : A TransferObject of type defined by link[@to] boolean : whether or not the collection contains this object.
findmanytomany[@name] transfer.com.TransferObject : A TransferObject of type defined by link[@to] (if collection[@type] == 'array')
numeric : The index of the object in the array
(if collection[@type] == 'struct')
string : the key the object is stored under.
⚠️ **GitHub.com Fallback** ⚠️