| simpleorm.core.SConstants
All known Subclasses: simpleorm.examples.Benchmarks, simpleorm.examples.GeneratedKeyTest, simpleorm.examples.ADemo, simpleorm.simplewebapp.eg.database.WInitPage, simpleorm.examples.LongTransactionTest, simpleorm.core.SConnection, simpleorm.core.SCon, simpleorm.examples.ColumnCacheTest, simpleorm.core.SQuery, simpleorm.core.SDriver, simpleorm.examples.ValidationTest, simpleorm.core.SDataLoader, simpleorm.examples.IdentFKeysTest, simpleorm.examples.CreateDBTest, simpleorm.examples.BasicTests, simpleorm.examples.DataTypesTest, simpleorm.simplewebapp.eg.database.WDumpRawPage, simpleorm.examples.TestUte,
SConstants | public interface SConstants extends SSimpleORMProperties(Code) | | Contains all the constants used by SimpleORM. Implementing this
interface will automatically import these constants which is
convenient. All constants are prefixed to avoid conflicts.
Bit fields are longs to alow for growth and to trap type errors if
they are mixed up with other int parameters. For flags, the low order
short is used to verfiy the parameter -- each flag set has a different
lower short. Parameters that use them are named *_flags where * is the
prefix, eg. sfd_bitSet.
Wouldn't it be wonderful if Java supported 30 year old constructs such
as enumerations and sets!
Constants and methods suffixed _unimp have not yet been
implemented. When they are, the suffix will be removed.
|
Field Summary | |
final static byte | INS_DIRTY | final static byte | INS_READ_ONLY | final static byte | INS_VALID Values of SRecordInstance.bitSets -- ie. | final static long | SQY_ SQY_: SimpleORM QuerY flags. | final static long | SQY_ASSUME_CREATE Optimization parameter to findOrCreate that causes SimpleORM to
assume that the the record does not already exist in the
database, and so does not do the initial SELECT .
Saves about 30%. | final static long | SQY_DESCRIPTIVE Only query fields marked SFD_DESCRIPTIVE . | final static long | SQY_NO_FOREIGN_KEYS Internal for DataLoader. | final static long | SQY_NO_GENERATED_KEYS Internal for queries. | final static long | SQY_NO_REFERENCES Internal for queries. | final static long | SQY_OPTIMISTIC Use Optimistic locking. | final static long | SQY_PRIMARY_KEY Causes only the primary key field(s) are queried. | final static long | SQY_READ_MOSTLY_unimp Retrieve the row from the Read Mostly cache. | final static long | SQY_READ_ONLY Do not lock the record in the database. | final static long | SQY_REFERENCE_NO_QUERY Prevents a query from being issued to lazzily fetch a reference.
getObject just returns Boolean.FALSE in this case. | final static long | SQY_UNQUERIED Include any columns that were marked SFD_UNQUERIED and so are not
normally retrieved. | final static long | SQY_UNREPEATABLE_READ Read without locking the record with a read lock. | final static long | SQY_UNREPEATABLE_READ_UNSAFE Read without locking the record with a read lock.
Important for MS SQL to prevent lock escalation.
For read behind dbs like Oracle/Postgresql this is the same as SQY_Read_Only
in that no "FOR UPDATE" is appended, yet the record is still updatable
(The read actually will probably be repeatable).
Note that this still enables the record to be updated.
This is very dangerous unless you are sure that no other
user could be accessing the records.
Eg. |
INS_DIRTY | final static byte INS_DIRTY(Code) | | |
INS_READ_ONLY | final static byte INS_READ_ONLY(Code) | | |
INS_VALID | final static byte INS_VALID(Code) | | Values of SRecordInstance.bitSets -- ie. internal.
|
SQY_ | final static long SQY_(Code) | | SQY_: SimpleORM QuerY flags. Controls which fields are queried,
and how.
|
SQY_ASSUME_CREATE | final static long SQY_ASSUME_CREATE(Code) | | Optimization parameter to findOrCreate that causes SimpleORM to
assume that the the record does not already exist in the
database, and so does not do the initial SELECT .
Saves about 30%. If the record does in fact exist you will get a
duplicate key error when the record is flushed.
|
SQY_DESCRIPTIVE | final static long SQY_DESCRIPTIVE(Code) | | Only query fields marked SFD_DESCRIPTIVE .
|
SQY_NO_FOREIGN_KEYS | final static long SQY_NO_FOREIGN_KEYS(Code) | | Internal for DataLoader. Do not include Foreign key column
fields, just the references.
|
SQY_NO_GENERATED_KEYS | final static long SQY_NO_GENERATED_KEYS(Code) | | Internal for queries. Do not include any generated keys.
|
SQY_NO_REFERENCES | final static long SQY_NO_REFERENCES(Code) | | Internal for queries. Do not include Reference fields, just
the fields that correspond to columns.
|
SQY_OPTIMISTIC | final static long SQY_OPTIMISTIC(Code) | | Use Optimistic locking. Ie. do not lock the record in the
database, but do remember the previous state of the row. If the
record is updated a check is made that the row has not been
updated by another session.
|
SQY_PRIMARY_KEY | final static long SQY_PRIMARY_KEY(Code) | | Causes only the primary key field(s) are queried. At least the
primary key field(s) are always queried.
|
SQY_READ_MOSTLY_unimp | final static long SQY_READ_MOSTLY_unimp(Code) | | Retrieve the row from the Read Mostly cache. Use with caution
because the returned row might be quite stale. Must not be
updated.
|
SQY_READ_ONLY | final static long SQY_READ_ONLY(Code) | | Do not lock the record in the database. Must not be updated
unless subsequently requeired without this flag set.
See SQY_UNREPEATABLE_READ
|
SQY_REFERENCE_NO_QUERY | final static long SQY_REFERENCE_NO_QUERY(Code) | | Prevents a query from being issued to lazzily fetch a reference.
getObject just returns Boolean.FALSE in this case. See
getReferenceNoQuery.
|
SQY_UNQUERIED | final static long SQY_UNQUERIED(Code) | | Include any columns that were marked SFD_UNQUERIED and so are not
normally retrieved.
|
SQY_UNREPEATABLE_READ | final static long SQY_UNREPEATABLE_READ(Code) | | Read without locking the record with a read lock.
It is also Read_Only.
Note that it is still not really safe if you are using read
data to update another record.
Important for MS SQL to prevent lock escalation.
Has no effect for read behind dbs like Oracle/Postgresql.
|
SQY_UNREPEATABLE_READ_UNSAFE | final static long SQY_UNREPEATABLE_READ_UNSAFE(Code) | | Read without locking the record with a read lock.
Important for MS SQL to prevent lock escalation.
For read behind dbs like Oracle/Postgresql this is the same as SQY_Read_Only
in that no "FOR UPDATE" is appended, yet the record is still updatable
(The read actually will probably be repeatable).
Note that this still enables the record to be updated.
This is very dangerous unless you are sure that no other
user could be accessing the records.
Eg. Detail records related to a master.
But if you get this wrong you will get unrepeatable data
corruption.
See SQY_UNREPEATABLE_READ.
And consider using optimistic locks if this really is a problem for you.
|
|
|