|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISqlGenerator
This interface represents all functions made available by the SQL generator in Mr. Persister. The SQL generator generates very simple SQL so it should be compatible with most database servers.
Method Summary | |
---|---|
java.lang.String |
generateDeleteStatement(IObjectMapping mapping)
Generates a delete SQL string based on the given object mapping. |
java.lang.String |
generateInsertStatement(IObjectMapping mapping)
Generates an insert SQL string based on the given object mapping. |
java.lang.String |
generateReadByPrimaryKeyStatement(IObjectMapping mapping)
Generates a read-by-primary-key SQL string based on the given object mapping. |
java.lang.String |
generateReadListByPrimaryKeysStatement(IObjectMapping mapping,
int primaryKeyCount)
Generates a read-by-primary-keys SQL string based on the given object mapping. |
java.lang.String |
generateUpdateOptimisticStatement(IObjectMapping mapping)
Generates an update SQL string based on the given object mapping with optimistic locking. |
java.lang.String |
generateUpdateStatement(IObjectMapping mapping)
Generates an updateBatch SQL string based on the given object mapping. |
Method Detail |
---|
java.lang.String generateReadByPrimaryKeyStatement(IObjectMapping mapping) throws PersistenceException
PreparedStatement
and thus does not contain the
value for the primary key itself, but a "?" character instead.
mapping
- The object mapping to generate the read-by-primary-key SQL string for.
String
instance containing the generated SQL.
PersistenceException
- If anything goes wrong during the SQL string generation.java.lang.String generateReadListByPrimaryKeysStatement(IObjectMapping mapping, int primaryKeyCount) throws PersistenceException
PreparedStatement
and thus does not contain the
value for the primary key itself, but a "?" character instead.
mapping
- The object mapping to generate the read-by-primary-key SQL string for.
String
instance containing the generated SQL.
PersistenceException
- If anything goes wrong during the SQL string generation.java.lang.String generateInsertStatement(IObjectMapping mapping) throws PersistenceException
PreparedStatement
and thus does not contain the
values to be inserted, but a series of "?" characters instead (comma separated).
mapping
- The object mapping to generate the insert SQL string for.
String
instance containing the generated SQL.
PersistenceException
- If anything goes wrong during the SQL string generation.java.lang.String generateUpdateStatement(IObjectMapping mapping) throws PersistenceException
PreparedStatement
and thus does not contain the
values to be updateBatch, but a series of "?" characters instead (comma separated).
mapping
- The object mapping to generate the updateBatch SQL string for.
String
instance containing the generated SQL.
PersistenceException
- If anything goes wrong during the SQL string generation.java.lang.String generateUpdateOptimisticStatement(IObjectMapping mapping) throws PersistenceException
PreparedStatement
and thus does not contain the
values to be updateBatch, but a series of "?" characters instead (comma separated).
mapping
- The object mapping to generate the updateBatch SQL string for.
String
instance containing the generated SQL.
PersistenceException
- If anything goes wrong during the SQL string generation.java.lang.String generateDeleteStatement(IObjectMapping mapping) throws PersistenceException
PreparedStatement
and thus does not contain the
value for the primary key of the record to delete itself, but a "?" character instead.
mapping
- The object mapping to generate the delete SQL string for.
String
instance containing the generated SQL.
PersistenceException
- If anything goes wrong during the SQL string generation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |