|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbutler.util.BaseGroovyObjectSupport
butler.sql.record.Record
public class Record
Record in the database.
Nested Class Summary | |
---|---|
static class |
Record.State
The state for a record. |
static class |
Record.ValidationException
|
Field Summary | |
---|---|
java.util.Map |
_relatedRecord
|
java.util.Map |
_relatedRecords
|
Constructor Summary | |
---|---|
Record(Table table)
|
|
Record(Table table,
java.lang.String content)
|
Method Summary | |
---|---|
void |
addRelatedRecord(ForeignKey fk,
Record rec)
|
void |
addRelatedRecord(Join join,
Record rec)
|
Record |
addRelatedRecord(ManyToManyRelation relation,
Record rec)
Connects a record using a many-to-many relation. |
void |
addRelatedRecord(java.lang.String fkName,
Record rec)
|
void |
checkMandatory()
|
void |
copy(java.util.Map map)
Copies the content of the given map to this record. |
void |
copy(Record rec)
Copies the content of the given record to this record. |
void |
delete()
Deletes the record in the database. |
void |
delete(boolean cascade)
|
boolean |
equals(java.lang.Object anOther)
|
java.lang.Object |
get(Column column)
Returns the value for the given column. |
java.lang.Object |
get(java.lang.String colname)
Returns the value for the given column. |
java.util.Set |
getChangedColumns()
|
java.util.Map |
getContent()
Returns the column values as a Map. |
double |
getDouble(Column col)
|
double |
getDouble(java.lang.String colname)
|
butler.util.Tuple |
getFKValues(ForeignKey fk)
|
java.lang.String |
getFormattedValue(Column col)
|
long |
getID()
|
int |
getInt(Column col)
|
int |
getInt(java.lang.String colname)
|
PrimaryKeyTuple |
getPrimaryKey()
Returns the values for the primary key. |
java.lang.Object |
getProperty(java.lang.String property)
|
Record |
getRelatedRecord(ForeignKey fk)
Returns the related record in a one-to-many relation. |
Record |
getRelatedRecord(java.lang.String fkName)
|
Record |
getRelatedRecord(Table table)
|
RecordList |
getRelatedRecords(ForeignKey fk)
Returns the related records in a many-to-one relation. |
RecordList |
getRelatedRecords(ManyToManyRelation relation)
|
RecordList |
getRelatedRecords(java.lang.String name)
|
RecordList |
getRelatedRecords(Table table)
|
Record.State |
getState()
Returns the state of this record. |
Table |
getTable()
Returns the table to which the record belongs. |
int |
hashCode()
|
void |
initDefaultValues()
|
boolean |
isAggregate()
|
boolean |
isChanged()
Checks if this record has changed in the database. |
void |
makeClean()
Make this record and all related records to clean. |
static Record |
parseRecord(org.dom4j.Element element)
|
static Record |
parseRecord(org.dom4j.Element element,
Join join)
|
static Record |
parseRecord(org.dom4j.Element element,
Query q)
|
static Record |
parseRecord(org.dom4j.Element element,
Table tab)
|
static Record |
parseXML(java.lang.String xml)
|
void |
reset()
|
void |
save()
Saves the record in the database by using update, insert or delete. |
void |
saveOptimistic()
|
void |
set(Column column,
java.lang.Object value)
Sets a column in the record. |
void |
set(java.lang.String colname,
java.lang.Object value)
Sets a column in the record. |
void |
setAggregate(boolean aggregate)
|
void |
setFormattedValue(Column col,
java.lang.String value)
|
void |
setPrimaryKey(butler.util.Tuple key)
|
void |
setProperty(java.lang.String property,
java.lang.Object newValue)
|
void |
setRelatedRecord(ForeignKey fk,
Record rec)
|
void |
setRelatedRecord(java.lang.String fkName,
Record rec)
|
void |
setRelatedRecords(ForeignKey fk,
RecordList recList)
|
void |
setRelatedRecords(ManyToManyRelation relation,
RecordList recList)
|
void |
setRelatedRecords(java.lang.String name,
RecordList recList)
|
void |
setState(Record.State state)
Sets the state of this record. |
java.lang.String |
toString()
|
java.lang.String |
toString(java.util.List cols)
|
java.lang.String |
toXML()
|
void |
toXML(org.xml.sax.ContentHandler handler)
|
void |
toXMLCompact(org.xml.sax.ContentHandler handler)
|
void |
toXMLCompact(org.xml.sax.ContentHandler handler,
java.util.List cols,
java.util.List nextJoins,
java.lang.String alias,
ForeignKey fk)
|
void |
toXMLSimple(org.xml.sax.ContentHandler handler,
java.util.List cols,
java.util.List nextJoins)
|
protected java.lang.String |
trim(java.lang.String str)
|
void |
unload(java.io.PrintStream stream)
|
void |
validate()
|
Methods inherited from class butler.util.BaseGroovyObjectSupport |
---|
getMetaClass, invokeMethod, setMetaClass |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public java.util.Map _relatedRecord
public java.util.Map _relatedRecords
Constructor Detail |
---|
public Record(Table table)
public Record(Table table, java.lang.String content) throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
public Table getTable() throws java.lang.Exception
java.lang.Exception
public void set(Column column, java.lang.Object value) throws java.lang.Exception
java.lang.Exception
public void set(java.lang.String colname, java.lang.Object value) throws java.lang.Exception
java.lang.Exception
public java.lang.Object get(Column column) throws java.lang.Exception
java.lang.Exception
public java.lang.Object get(java.lang.String colname) throws java.lang.Exception
java.lang.Exception
public int getInt(Column col) throws java.lang.Exception
java.lang.Exception
public int getInt(java.lang.String colname) throws java.lang.Exception
java.lang.Exception
public double getDouble(Column col) throws java.lang.Exception
java.lang.Exception
public double getDouble(java.lang.String colname) throws java.lang.Exception
java.lang.Exception
public java.lang.Object getProperty(java.lang.String property)
getProperty
in interface groovy.lang.GroovyObject
getProperty
in class butler.util.BaseGroovyObjectSupport
public void setProperty(java.lang.String property, java.lang.Object newValue)
setProperty
in interface groovy.lang.GroovyObject
setProperty
in class butler.util.BaseGroovyObjectSupport
public java.lang.String getFormattedValue(Column col) throws java.lang.Exception
java.lang.Exception
public void setFormattedValue(Column col, java.lang.String value) throws java.lang.Exception
java.lang.Exception
public PrimaryKeyTuple getPrimaryKey() throws java.lang.Exception
java.lang.Exception
public void setPrimaryKey(butler.util.Tuple key) throws java.lang.Exception
java.lang.Exception
public java.util.Map getContent()
public void save() throws java.lang.Exception
java.lang.Exception
public void delete() throws java.lang.Exception
java.lang.Exception
public void delete(boolean cascade) throws java.lang.Exception
java.lang.Exception
public void copy(Record rec) throws java.lang.Exception
java.lang.Exception
public void copy(java.util.Map map) throws java.lang.Exception
java.lang.Exception
public Record.State getState()
public void setState(Record.State state) throws java.lang.Exception
java.lang.Exception
public Record getRelatedRecord(ForeignKey fk) throws java.lang.Exception
java.lang.Exception
public Record getRelatedRecord(Table table) throws java.lang.Exception
java.lang.Exception
public Record getRelatedRecord(java.lang.String fkName) throws java.lang.Exception
java.lang.Exception
public RecordList getRelatedRecords(ForeignKey fk) throws java.lang.Exception
java.lang.Exception
public RecordList getRelatedRecords(java.lang.String name) throws java.lang.Exception
java.lang.Exception
public RecordList getRelatedRecords(Table table) throws java.lang.Exception
java.lang.Exception
public void setRelatedRecord(ForeignKey fk, Record rec) throws java.lang.Exception
java.lang.Exception
public void setRelatedRecord(java.lang.String fkName, Record rec) throws java.lang.Exception
java.lang.Exception
public void setRelatedRecords(ForeignKey fk, RecordList recList)
public void setRelatedRecords(java.lang.String name, RecordList recList)
public void addRelatedRecord(Join join, Record rec) throws java.lang.Exception
java.lang.Exception
public void addRelatedRecord(java.lang.String fkName, Record rec) throws java.lang.Exception
java.lang.Exception
public void addRelatedRecord(ForeignKey fk, Record rec) throws java.lang.Exception
java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.util.List cols)
public void toXMLCompact(org.xml.sax.ContentHandler handler) throws java.lang.Exception
java.lang.Exception
public void toXMLCompact(org.xml.sax.ContentHandler handler, java.util.List cols, java.util.List nextJoins, java.lang.String alias, ForeignKey fk) throws java.lang.Exception
java.lang.Exception
public void toXMLSimple(org.xml.sax.ContentHandler handler, java.util.List cols, java.util.List nextJoins) throws java.lang.Exception
java.lang.Exception
public java.lang.String toXML() throws java.lang.Exception
java.lang.Exception
public void toXML(org.xml.sax.ContentHandler handler) throws java.lang.Exception
java.lang.Exception
public boolean equals(java.lang.Object anOther)
equals
in class java.lang.Object
protected java.lang.String trim(java.lang.String str)
public void unload(java.io.PrintStream stream) throws java.lang.Exception
java.lang.Exception
public java.util.Set getChangedColumns()
public static Record parseXML(java.lang.String xml) throws java.lang.Exception
java.lang.Exception
public static Record parseRecord(org.dom4j.Element element) throws java.lang.Exception
java.lang.Exception
public static Record parseRecord(org.dom4j.Element element, Table tab) throws java.lang.Exception
java.lang.Exception
public static Record parseRecord(org.dom4j.Element element, Query q) throws java.lang.Exception
java.lang.Exception
public static Record parseRecord(org.dom4j.Element element, Join join) throws java.lang.Exception
java.lang.Exception
public boolean isChanged() throws java.lang.Exception
java.lang.Exception
public void saveOptimistic() throws java.lang.Exception
java.lang.Exception
public Record addRelatedRecord(ManyToManyRelation relation, Record rec) throws java.lang.Exception
java.lang.Exception
public void setRelatedRecords(ManyToManyRelation relation, RecordList recList) throws java.lang.Exception
java.lang.Exception
public RecordList getRelatedRecords(ManyToManyRelation relation) throws java.lang.Exception
java.lang.Exception
public void validate() throws java.lang.Exception
java.lang.Exception
public int hashCode()
hashCode
in class java.lang.Object
public long getID()
public void reset() throws java.lang.Exception
java.lang.Exception
public butler.util.Tuple getFKValues(ForeignKey fk) throws java.lang.Exception
java.lang.Exception
public void initDefaultValues() throws java.lang.Exception
java.lang.Exception
public void checkMandatory() throws MandatoryColumnException, java.lang.Exception
MandatoryColumnException
java.lang.Exception
public void makeClean() throws java.lang.Exception
java.lang.Exception
public boolean isAggregate()
public void setAggregate(boolean aggregate)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |