|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjnicli.DatabaseSessionClient
Database session client implementation. This class implements Database interface using proxy object to access remote database server. The role of this class is to keep session context.
Field Summary |
Fields inherited from interface jnicli.Database |
AUTOCOMMIT, CLI_DETACH_COMMIT, CLI_DETACH_DEFAULT, CLI_DETACH_DESTROY_CONTEXT, CONCURRENT_READ, CONCURRENT_UPDATE, FOR_UPDATE, READ_ONLY, READ_WRITE |
Constructor Summary | |
DatabaseSessionClient(DatabaseSession proxy)
|
Method Summary | |
void |
attach()
Attach thread to the database. |
void |
close()
Close database |
void |
commit()
Commit current transaction. |
int |
delete(java.lang.Class table,
java.lang.String condition)
Delete all objects from the table matching specified condition |
void |
detach(int flags)
Detach thread to the database. |
long |
insert(java.lang.Object obj)
Insert new object in the database. |
void |
lock()
Lock database in exclusive mode. |
void |
open(int accessType,
java.lang.String databaseName,
java.lang.String databasePath,
long initSize,
int transactionCommitDelay)
Open database |
void |
rollback()
Commit current transaction Transaction is implicitly started when any database operation is perfromed. |
Cursor |
select(java.lang.Class table,
java.lang.String condition,
int flags)
Select objects from table matching condition |
void |
update(long oid,
java.lang.Object obj)
Update object with soecified OID |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DatabaseSessionClient(DatabaseSession proxy)
Method Detail |
public void open(int accessType, java.lang.String databaseName, java.lang.String databasePath, long initSize, int transactionCommitDelay)
Database
open
in interface Database
accessType
- database access type: one of READ_ONLY, READ_WRITE, CONCURRENT_READ or CONCURRENT_UPDATEdatabaseName
- database namedatabasePath
- path to the database fileinitSize
- initial size of databasetransactionCommitDelay
- transaction commit delay (specify 0 to disable)public void close()
Database
close
in interface Database
public Cursor select(java.lang.Class table, java.lang.String condition, int flags)
Database
select
in interface Database
table
- class corresponding to the tablecondition
- SubSQL condition (to select all records pass empty string)flags
- combination of FOR_UPDATE and AUTOCOMMIT flags
public void update(long oid, java.lang.Object obj)
Database
update
in interface Database
oid
- OID of updated objectobj
- updated objectpublic long insert(java.lang.Object obj)
Database
insert
in interface Database
obj
- inserted object
public int delete(java.lang.Class table, java.lang.String condition)
Database
delete
in interface Database
table
- class corresponding to the tablecondition
- SubSQL condition (to delete all records pass empty string)
public void commit()
Database
commit
in interface Database
public void rollback()
Database
rollback
in interface Database
public void lock()
Database
lock
in interface Database
public void attach()
Database
attach
in interface Database
public void detach(int flags)
Database
detach
in interface Database
flags
- combination of CLI_DETACH_COMMIT and CLI_DETACH_DESTROY_CONTEXT flags
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |