public class SRecordMeta<T extends SRecordInstance>
extends java.lang.Object
implements java.io.Serializable
SRecordInstance
such as the table name.
Details about each field are stored in SFieldMeta
refered 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 SRecordInstance
es
such as #findOrCreate
and #select
. (This packaging makes the
calls shorter than using a static method on SRecordInstance.)
Modifier and Type | Field and Description |
---|---|
boolean |
quoteName |
Constructor and Description |
---|
SRecordMeta(java.lang.Class<T> userClass,
java.lang.String tableName)
Create a new table/record definition.
|
Modifier and Type | Method and Description |
---|---|
SFieldScalar[] |
fieldsForMode(SSelectMode selectMode)
Returns SFieldMetas that are updated to select given SelectMode.
|
SFieldScalar[] |
getAllScalarFields() |
SFieldScalar[] |
getDescriptiveScalarFields() |
SFieldMeta |
getField(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 meta
|
SFieldScalar[] |
getQueriedScalarFields() |
java.lang.String |
getTableName() |
java.lang.Class<T> |
getUserClass() |
java.util.Map |
getUserProperties() |
<T> T |
getUserProperty(java.lang.Object key) |
SRecordMeta |
putUserProperty(java.lang.Object key,
java.lang.Object value) |
protected java.lang.Object |
readResolve()
SRecordMeta is like a singleton, in that only one instance of SRecordMeta
must exist in the VM for a specific table.
|
SRecordMeta |
setQuoted(boolean quote)
Causes the generated sql to quote ("") the table name.
|
java.lang.String |
toLongerString()
Displays all columns
|
java.lang.String |
toString() |
public SRecordMeta(java.lang.Class<T> userClass, java.lang.String tableName)
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.protected java.lang.Object readResolve() throws java.io.ObjectStreamException
(This method is reflected into and magically called by serialization.)
java.io.ObjectStreamException
public java.util.List<SFieldMeta> getFieldMetas()
public SFieldScalar[] fieldsForMode(SSelectMode selectMode)
public SFieldScalar[] getPrimaryKeys()
public SFieldScalar[] getQueriedScalarFields()
public SFieldScalar[] getAllScalarFields()
public SFieldScalar[] getDescriptiveScalarFields()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toLongerString()
public java.lang.Class<T> getUserClass()
public java.util.Set<java.lang.String> getFieldNames()
public SFieldMeta getField(java.lang.String fieldName)
public java.lang.String getTableName()
public SRecordMeta setQuoted(boolean quote)
public SRecordMeta putUserProperty(java.lang.Object key, java.lang.Object value)
public <T> T getUserProperty(java.lang.Object key)
public java.util.Map getUserProperties()