| simpleorm.core.SSimpleORMProperties
SSimpleORMProperties | public interface SSimpleORMProperties (Code) | | This interface contains all the SProperties constants used in
SimpleORM. Properties are a general way to attach extra information
to SRecordMetas and SFieldMetas. They are usually used as follows:-
public static final SFieldObject TSTAMP_OBJ =
new SFieldObject(meta, "TSTAMP_OBJ",
SDATA_TYPE.pvalue("TIMESTAMP"));
public static final SFieldString DATA_ID =
new SFieldString(meta, "DATA_ID", 10, SFD_PRIMARY_KEY);
Each of the SField* initializers allows 0, 1, 2 or an
array of SPropertyValues to be passed as trailing
parameters. Each of these contains an SProperty and a value for that
property. Thus the first example adds a property
SDATA_TYPE to the TSTAMP_OBJ field with
value "TIMESTAMP" .
As a convenience the SFD_ constants contain precreated
SPropertyValues for simple boolean properties. So the
second example is just a short cut for:-
public static final SFieldString DATA_ID =
new SFieldString(meta, "DATA_ID", 10,
SPRIMARY_KEY.pvalue(Boolean.TRUE));
(Due to a bug in Javadoc (1.3 at least) anonymous classes cannot be used to initiate static constants.)
|
Inner Class :public static class SPropertySFieldMetas extends SProperty | |
Inner Class :public static class SPropertySFieldMap extends SProperty | |
Inner Class :public static class SPropertySRecordMeta extends SProperty | |
Inner Class :public static class SPropertySFieldIndex extends SProperty | |
Inner Class :public static class SPropertySTableName extends SProperty | |
Inner Class :public static class SPropertySDataType extends SProperty | |
Inner Class :public static class SPropertyNoForeignKey extends SProperty | |
Inner Class :public static class SPropertySFieldReference extends SProperty | |
Inner Class :public static class SPropertyInnerForeignKey extends SProperty | |
Inner Class :public static class SPropertySGeneratedKey extends SProperty | |
Inner Class :public static class SPropertySSequenceName extends SProperty | |
SBYTE_SIZE | final static SProperty SBYTE_SIZE(Code) | | The parameter to the Varchar(...) data type on the Create Table
statement. Note that it is normally the number of bytes, not the
number of characters (in UTF-8, say). It is a meaningless number,
but most databases demand it. Postgresql does not, and it is not
used in that case.
|
SCOLUMN_NAME | final static SProperty SCOLUMN_NAME(Code) | | Name of the SQL column.
|
SCOLUMN_QUERY | final static SProperty SCOLUMN_QUERY(Code) | | Query fragment to select value. May be a subselect.
Normally also SUNQUERIED. Never updates.
|
SDATA_TYPE | final static SProperty SDATA_TYPE(Code) | | The SQL data type of the column. For the generic driver this
corresponds to the actual type used in the Create Table
statement.
Warning, these may be mapped by the SDrivers to try to overcome
type incompatibilities.
|
SDECIMAL_PRECISION | final static SProperty SDECIMAL_PRECISION(Code) | | The precission and scale of Numerics for BigDecimal. Used to
generate NUMERIC(precission, scale) in CREATE TABLE
statements.
|
SDESCRIPTIVE | final static SProperty SDESCRIPTIVE(Code) | | Only "Descriptive" fields (eg. Name) will be queried if
SQY_DESCRIPTIVE is specified.
|
SEXTRA_COLUMN_DDL | final static SProperty SEXTRA_COLUMN_DDL(Code) | | Extra text that is appended blindly after the DDL
CREATE TABLE column type information but before the
",". Can be used for database specific tuning, check clauses
etc.
|
SEXTRA_FKEY_DDL | final static SProperty SEXTRA_FKEY_DDL(Code) | | Extra text that is appended blindly at the very end of a foreign
key definition. A typical value is " ON DELETE CASCADE". (No
attempt is made by SimpleORM to keep the cache consistent with
changes to the database made in this way.)
|
SEXTRA_TABLE_DDL | final static SProperty SEXTRA_TABLE_DDL(Code) | | Extra text that is appended blindly at the very end of
the DDL CREATE TABLE (..., PRIMARY KEY... but
before the closing ")". Can be used for database specific
tuning, check clauses etc. This text usually begins with a ",".
|
SFIELD_INDEX | final static SProperty SFIELD_INDEX(Code) | | Index into SFIELD_METAS of an sFieldMeta.
ie. field.SRECORD_META.SFIELD_METAS[field.SFIELD_INDEX] ==
field .
|
SFIELD_MAP | final static SProperty SFIELD_MAP(Code) | | Map of all fields in an SRecordMeta. Same elements as
SFIELD_METAS , but a HashMap instead of an array,
keyed by the SFIELD_NAME name.
Normally just use SRecordMeta.getField(name) to
retrieve fields by name.
|
SFIELD_METAS | final static SProperty SFIELD_METAS(Code) | | The array of fields with in an SRecordMeta.
|
SFIELD_NAME | final static SProperty SFIELD_NAME(Code) | | Arbitrary field name to be used by applications. Defaults to
column name or to Column name or prefix or Referenced table name
for references.
|
SFIELD_REFERENCE | final static SProperty SFIELD_REFERENCE(Code) | | If Field A.SFIELD_REFERENCE = Field B then B is a
SFieldReference field and A forms a part of that reference.
Eg. if B = Employee.Department, A=Employee.Dept_Id.
|
SGENERATED_KEY | final static SProperty SGENERATED_KEY(Code) | | A generated primary key column.
The value must be an SGenerator subtype.
See GeneratedKeyTest.
|
SINNER_FOREIGN_KEY | final static SProperty SINNER_FOREIGN_KEY(Code) | | Normally only top level foreign keys are generated. So
PayrollDetail to Payroll is foreign key is normally generated,
but not the nested PayrollDetail to Employee. However, this
property can be used to enable inner foreign keys to be
generated as well. (Rarely used in practice.)
|
SMANDATORY | final static SProperty SMANDATORY(Code) | | The field must not be "empty" when the record is flushed. It may
temporarily be empty in the meantime.
In order to avoid the horrible SQL NULL semantics, some
databases prefer to store empty string values as ""
rather than NULL s (eg. Sybase, MSSQL). For now
SMANDATORY just means NOT NULL in
create table statements. A java value of ""
produces SQL "" , a java null produces
sql null .
### Additional null semantics will be provided later that unify
"" and null to provide output
appropriate for the database used. This will make it easier to
write database independent code, and avoid horrible bugs when
the two are confused.
See Also: SRecordInstance.isEmpty |
SNO_FOREIGN_KEY | final static SProperty SNO_FOREIGN_KEY(Code) | | SFieldReference property that suppresses the generation of
Foreign Key constraint DDL. Defaults from Record and thence Connection.
|
SOPTIMISTIC_UNCHECKED | final static SProperty SOPTIMISTIC_UNCHECKED(Code) | | Suppresses this column being used as a foreign key component.
Must be used for database types that cannot be used in WHERE
clauses such as Oracle's long type.
|
SPRIMARY_KEY | final static SProperty SPRIMARY_KEY(Code) | | Indicates which are the primary key field(s).
Every record must have a primary key.
|
SRECORD_META | final static SProperty SRECORD_META(Code) | | The record that an SFieldMeta is associated with.
|
SSEQUENCE_NAME | static SProperty SSEQUENCE_NAME(Code) | | Name of the sequence to use for the generated key for databases
that support them (eg. Postgresql). Defaults to
tablename_SEQ. Boolean.FALSE is a special value that causes
the default Select Max algoritm to be used.
|
SSTRING_CHAR | final static SProperty SSTRING_CHAR(Code) | | Specifies that the String datatype is to be represented as a
CHAR and not a VARCHAR.
|
STABLE_NAME | static SProperty STABLE_NAME(Code) | | The table name of this record OR field.
|
SUNQUERIED | final static SProperty SUNQUERIED(Code) | | SUNQUERIED fields are not normally retrieved by
queries unless the SQY_UNQUERIED flag is specified
on the query. Typically large, rarely used fields.
|
|
|