Package simpleorm.dataset
Class SRecordMeta<T extends SRecordInstance>
- java.lang.Object
- 
- simpleorm.dataset.SRecordMeta<T>
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 - Direct Known Subclasses:
- RecordMeta
 
 public class SRecordMeta<T extends SRecordInstance> extends java.lang.Object implements java.io.SerializableDefines the meta data for aSRecordInstancesuch as the table name. Details about each field are stored inSFieldMetarefered to from this object.Thus Instance Variables of this class only describe the definition of a Record, not instances or connections. This class also contains routines to create new SRecordInstancees such as#findOrCreateand#select. (This packaging makes the calls shorter than using a static method on SRecordInstance.)- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description booleanquoteName
 - 
Constructor SummaryConstructors Constructor Description SRecordMeta(java.lang.Class<T> userClass, java.lang.String tableName)Create a new table/record definition.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description SFieldScalar[]fieldsForMode(SSelectMode selectMode)Returns SFieldMetas that are updated to select given SelectMode.SFieldScalar[]getAllScalarFields()SFieldScalar[]getDescriptiveScalarFields()SFieldMetagetField(java.lang.String fieldName)Returns the field by its name, or null if not found.java.util.List<SFieldMeta>getFieldMetas()java.util.Set<java.lang.String>getFieldNames()All the field names.SFieldScalar[]getPrimaryKeys()Get the scalar primary key fields meta for this record metaSFieldScalar[]getQueriedScalarFields()java.lang.StringgetTableName()java.lang.Class<T>getUserClass()java.util.MapgetUserProperties()<T> TgetUserProperty(java.lang.Object key)SRecordMetaputUserProperty(java.lang.Object key, java.lang.Object value)protected java.lang.ObjectreadResolve()SRecordMeta is like a singleton, in that only one instance of SRecordMeta must exist in the VM for a specific table.SRecordMetasetQuoted(boolean quote)Causes the generated sql to quote ("") the table name.java.lang.StringtoLongerString()Displays all columnsjava.lang.StringtoString()
 
- 
- 
- 
Constructor Detail- 
SRecordMetapublic SRecordMeta(java.lang.Class<T> userClass, java.lang.String tableName) Create a new table/record definition.- Parameters:
- userClass- an instance of the class this RecordMeta holds the metadata for (ie T )
- tableName- The name of the SQL table that will be associated with this record.
 
 
- 
 - 
Method Detail- 
readResolveprotected java.lang.Object readResolve() throws java.io.ObjectStreamExceptionSRecordMeta is like a singleton, in that only one instance of SRecordMeta must exist in the VM for a specific table. This is a special method used during de-serialization to determine if the object de-serialized should be substituted. This method is implemented to return the SRecordMeta object for the appropriate user Class that already exists.(This method is reflected into and magically called by serialization.) - Throws:
- java.io.ObjectStreamException
 
 - 
getFieldMetaspublic java.util.List<SFieldMeta> getFieldMetas() - Returns:
- the an unmodifiable view of the field metas (both Scalar and References)
 
 - 
fieldsForModepublic SFieldScalar[] fieldsForMode(SSelectMode selectMode) Returns SFieldMetas that are updated to select given SelectMode.
 - 
getPrimaryKeyspublic SFieldScalar[] getPrimaryKeys() Get the scalar primary key fields meta for this record meta- Returns:
- a readonly list of the primary key Fields meta of the record meta
 
 - 
getQueriedScalarFieldspublic SFieldScalar[] getQueriedScalarFields() 
 - 
getAllScalarFieldspublic SFieldScalar[] getAllScalarFields() 
 - 
getDescriptiveScalarFieldspublic SFieldScalar[] getDescriptiveScalarFields() 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
toLongerStringpublic java.lang.String toLongerString() Displays all columns
 - 
getUserClasspublic java.lang.Class<T> getUserClass() 
 - 
getFieldNamespublic java.util.Set<java.lang.String> getFieldNames() All the field names. use getField to look up the actual field.
 - 
getFieldpublic SFieldMeta getField(java.lang.String fieldName) Returns the field by its name, or null if not found.
 - 
getTableNamepublic java.lang.String getTableName() 
 - 
setQuotedpublic SRecordMeta setQuoted(boolean quote) Causes the generated sql to quote ("") the table name. Makes it case sensitive, allows reserved words and odd characters. Beware that Postgresql (only) defaults to lower case, not upper case.
 - 
putUserPropertypublic SRecordMeta putUserProperty(java.lang.Object key, java.lang.Object value) 
 - 
getUserPropertypublic <T> T getUserProperty(java.lang.Object key) 
 - 
getUserPropertiespublic java.util.Map getUserProperties() 
 
- 
 
-