|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IGetterMapping
This interface represents the functions special to getter method mappings.
Getter method mappings represent a method from a getter method in a class
to a column in the database.
Getter method mappings are used when writing/updating objects to/in the database.
Getter method mappings can extract the values from objects to be inserted/updated
by calling the getter method they are method from (on the target object),
and insert these values into a PreparedStatement
). Getter method
mappings are also used when doing a read-by-primary-key.
Method Summary | |
---|---|
void |
insertObject(java.lang.Object value,
java.sql.PreparedStatement statement,
int index)
This method inserts the given object into the given PreparedStatement
as a statement parameter using the given index as index to what "?" in
the PreparedStatement to insert the value for. |
void |
insertValueFromObject(java.lang.Object target,
java.sql.PreparedStatement statement,
int index)
This method extracts a value from an object by calling the getter method associated with this getter method method on the target object. |
boolean |
isAutoGenerated()
Returns whether or not the value of the column in the database matching this getter method method is auto generated by the database. |
void |
setAutoGenerated(boolean isAutoGenerated)
Sets whether or not the value of the column in the database matching this getter method method is auto generated by the database. |
Methods inherited from interface com.jenkov.mrpersister.itf.mapping.IMethodMapping |
---|
getColumnName, getColumnType, getObjectMethod, isPrimaryKey, isTableMapped, setColumnName, setColumnType, setObjectMethod, setPrimaryKey, setTableMapped |
Method Detail |
---|
void insertValueFromObject(java.lang.Object target, java.sql.PreparedStatement statement, int index) throws PersistenceException
PreparedStatement
as a statement parameter using the
given index as index to what "?" in the PreparedStatement
to insert
the value for.
target
- The object to extract the value from.statement
- The PreparedStatement
to insert the value into.index
- The index to insert the value into the PreparedStatement
at.
PersistenceException
- If anything goes wrong during the insertion.void insertObject(java.lang.Object value, java.sql.PreparedStatement statement, int index) throws PersistenceException
PreparedStatement
as a statement parameter using the given index as index to what "?" in
the PreparedStatement
to insert the value for.
value
- The object to insert.statement
- The PreparedStatement
to insert the value into.index
- The index to insert the value into the PreparedStatement
at.
PersistenceException
- If anything goes wrong during the insertion.boolean isAutoGenerated()
void setAutoGenerated(boolean isAutoGenerated)
isAutoGenerated
- Set to true if the column value is auto generated by the database.
False if not.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |