|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jora.Table
Table class is used to establish mapping between corteges of database tables and Java classes. This class is responsible for constructing SQL statements for extracting, updating and deleting records of the database table.
Field Summary | |
static java.lang.String |
fieldSeparator
Spearator of name components of compound field. |
static boolean |
useDepricatedGetBigDecimal
Some versions of JDBC driver doesn't support getBigDecimal(int columnIndex) . |
Constructor Summary | |
Table(java.lang.String className)
Constructor of table with "key" and "session" parameters inherited from base table. |
|
Table(java.lang.String className,
Session s)
Constructor of table without explicit key specification. |
|
Table(java.lang.String className,
Session s,
java.lang.String key)
Constructor for table object. |
|
Table(java.lang.String className,
Session s,
java.lang.String[] keys)
Constructor for table object. |
|
Table(java.lang.String className,
java.lang.String tableName,
Session s,
java.lang.String key)
Constructor for table object. |
|
Table(java.lang.String className,
java.lang.String tableName,
Session s,
java.lang.String[] keys)
Constructor for table object. |
Method Summary | |
int |
delete(java.lang.Object obj)
Delete record with specified value of primary key from the table. |
int |
delete(java.lang.Object[] objects)
Delete records with specified primary keys from the table. |
int |
delete(java.lang.Object[] objects,
Session session)
Delete records with specified primary keys from the table. |
int |
delete(java.lang.Object obj,
Session session)
Delete record with specified value of primary key from the table. |
void |
insert(java.lang.Object obj)
Insert new record in the table. |
void |
insert(java.lang.Object[] objects)
Insert several new records in the table. |
void |
insert(java.lang.Object[] objects,
Session session)
Insert several new records in the table. |
void |
insert(java.lang.Object obj,
Session session)
Insert new record in the table using specified database session. |
Cursor |
queryAllByExample(java.lang.Object obj)
Select records from specified and derived database tables using obj object as template for selection. |
Cursor |
queryAllByExample(java.lang.Object obj,
Session session)
Select records from specified and derived database tables using obj object as template for selection. |
Cursor |
queryByExample(java.lang.Object obj)
Select records from database table using obj object as template for selection. |
Cursor |
queryByExample(java.lang.Object obj,
Session session)
Select records from database table using obj object as template for selection. |
Cursor |
select(java.lang.String condition)
Select records from database table according to search condition |
Cursor |
select(java.lang.String condition,
Session session)
Select records from database table according to search condition |
Cursor |
selectAll(java.lang.String condition)
Select records from specified and derived database tables |
Cursor |
selectAll(java.lang.String condition,
Session session)
Select records from specified and derived database tables |
int |
update(java.lang.Object obj)
Update record in the table using table's primary key to locate record in the table and values of fields of specified object obj to alter record fields. |
int |
update(java.lang.Object[] objects)
Update set of records in the table using table's primary key to locate record in the table and values of fields of objects from sepecifed array objects to alter record fields. |
int |
update(java.lang.Object[] objects,
Session session)
Update set of records in the table using table's primary key to locate record in the table and values of fields of objects from sepecifed array objects to alter record fields. |
int |
update(java.lang.Object obj,
Session session)
Update record in the table using table's primary key to locate record in the table and values of fields of specified object obj to alter record fields. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static java.lang.String fieldSeparator
public static boolean useDepricatedGetBigDecimal
getBigDecimal(int columnIndex)
. Setting this variable to
true
makes JORA to explicitly request scale from result
set metadata and use deprecated version of getBigDecimal
with extra scale
parameter.Constructor Detail |
public Table(java.lang.String className, java.lang.String tableName, Session s, java.lang.String key)
tclassName
- name of Java classtableName
- name of database table mapped on this Java classkey
- table's primary key. This parameter is used in UPDATE/DELETE
operations to locate record in the table.public Table(java.lang.String className, java.lang.String tableName, Session s, java.lang.String[] keys)
tclassName
- name of Java classtableName
- name of database table mapped on this Java classkeys
- table primary keys. This parameter is used in UPDATE/DELETE
operations to locate record in the table.public Table(java.lang.String className, Session s, java.lang.String[] keys)
className
- name of Java class, which should be (without
package prefix) be the same as the name of database table.keys
- table primary keys. This parameter is used in UPDATE/DELETE
operations to locate record in the table.public Table(java.lang.String className, Session s, java.lang.String key)
className
- name of Java class, which should be (without
package prefix) be the same as the name of database table.key
- table primary key. This parameter is used in UPDATE/DELETE
operations to locate record in the table.public Table(java.lang.String className, Session s)
public Table(java.lang.String className)
Method Detail |
public final Cursor select(java.lang.String condition)
condition
- valid SQL condition expression started with WHERE
or empty string if all records should be fetched.public final Cursor select(java.lang.String condition, Session session)
condition
- valid SQL condition expression started with WHERE
or empty string if all records should be fetched.session
- user database sessionpublic final Cursor selectAll(java.lang.String condition)
condition
- valid SQL condition expression started with WHERE
or empty string if all records should be fetched.public final Cursor selectAll(java.lang.String condition, Session session)
condition
- valid SQL condition expression started with WHERE
or empty string if all records should be fetched.session
- user database sessionpublic final Cursor queryByExample(java.lang.Object obj)
obj
- object for construction search condition: selected objects
should match all non-null fields of specified object.public final Cursor queryByExample(java.lang.Object obj, Session session)
obj
- object for construction search condition: selected objects
should match all non-null fields of specified object.session
- user database sessionpublic final Cursor queryAllByExample(java.lang.Object obj)
obj
- object for construction search condition: selected objects
should match all non-null fields of specified object.public final Cursor queryAllByExample(java.lang.Object obj, Session session)
obj
- object for construction search condition: selected objects
should match all non-null fields of specified object.session
- user database sessionpublic void insert(java.lang.Object obj)
obj
- object specifing values of inserted record fieldspublic void insert(java.lang.Object obj, Session session)
obj
- object specifing values of inserted record fieldssession
- user database sessionpublic void insert(java.lang.Object[] objects)
objects
- array with objects specifing values of inserted record
fieldspublic void insert(java.lang.Object[] objects, Session session)
objects
- array with objects specifing values of inserted record
fieldssession
- user database sessionpublic int update(java.lang.Object obj)
obj
- object specifing value of primary key and new values of
updated record fieldspublic int update(java.lang.Object obj, Session session)
obj
- object specifing value of primary key and new values of
updated record fieldssession
- user database sessionpublic int update(java.lang.Object[] objects)
objects
- array of objects specifing primiray keys and and new
values of updated record fieldspublic int update(java.lang.Object[] objects, Session session)
objects
- array of objects specifing primiray keys and and new
values of updated record fieldssession
- user database sessionpublic int delete(java.lang.Object obj)
obj
- object containing value of primary key.public int delete(java.lang.Object obj, Session session)
obj
- object containing value of primary key.session
- user database sessionpublic int delete(java.lang.Object[] objects)
objects
- array of objects containing values of primary key.public int delete(java.lang.Object[] objects, Session session)
objects
- array of objects containing values of primary key.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |