|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jenkov.mrpersister.impl.SqlGenerator
public class SqlGenerator
Constructor Summary | |
---|---|
SqlGenerator()
|
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. |
protected void |
validateObjectMapping(IObjectMapping mapping)
|
protected void |
validatePrimaryKey(IObjectMapping mapping)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SqlGenerator()
Method Detail |
---|
public java.lang.String generateReadByPrimaryKeyStatement(IObjectMapping mapping) throws PersistenceException
ISqlGenerator
PreparedStatement
and thus does not contain the
value for the primary key itself, but a "?" character instead.
generateReadByPrimaryKeyStatement
in interface ISqlGenerator
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.public java.lang.String generateReadListByPrimaryKeysStatement(IObjectMapping mapping, int primaryKeyCount) throws PersistenceException
ISqlGenerator
PreparedStatement
and thus does not contain the
value for the primary key itself, but a "?" character instead.
generateReadListByPrimaryKeysStatement
in interface ISqlGenerator
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.public java.lang.String generateInsertStatement(IObjectMapping mapping) throws PersistenceException
ISqlGenerator
PreparedStatement
and thus does not contain the
values to be inserted, but a series of "?" characters instead (comma separated).
generateInsertStatement
in interface ISqlGenerator
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.public java.lang.String generateUpdateStatement(IObjectMapping mapping) throws PersistenceException
ISqlGenerator
PreparedStatement
and thus does not contain the
values to be updateBatch, but a series of "?" characters instead (comma separated).
generateUpdateStatement
in interface ISqlGenerator
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.public java.lang.String generateUpdateOptimisticStatement(IObjectMapping mapping) throws PersistenceException
ISqlGenerator
PreparedStatement
and thus does not contain the
values to be updateBatch, but a series of "?" characters instead (comma separated).
generateUpdateOptimisticStatement
in interface ISqlGenerator
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.public java.lang.String generateDeleteStatement(IObjectMapping mapping) throws PersistenceException
ISqlGenerator
PreparedStatement
and thus does not contain the
value for the primary key of the record to delete itself, but a "?" character instead.
generateDeleteStatement
in interface ISqlGenerator
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.protected void validateObjectMapping(IObjectMapping mapping) throws PersistenceException
PersistenceException
protected void validatePrimaryKey(IObjectMapping mapping) throws PersistenceException
PersistenceException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |