|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.samskivert.jdbc.depot.ValueGenerator
com.samskivert.jdbc.depot.TableValueGenerator
public class TableValueGenerator
Generates primary keys using an external table .
| Field Summary | |
|---|---|
protected boolean |
_initialized
|
protected String |
_pkColumnName
|
protected String |
_pkColumnValue
|
protected String |
_valueColumnName
|
protected String |
_valueTable
|
| Fields inherited from class com.samskivert.jdbc.depot.ValueGenerator |
|---|
_allocationSize, _dm, _fm, _initialValue, _migrateIfExists |
| Constructor Summary | |
|---|---|
TableValueGenerator(TableGenerator tg,
GeneratedValue gv,
DepotMarshaller<?> dm,
FieldMarshaller<?> fm)
|
|
| Method Summary | |
|---|---|
protected static String |
defStr(String value,
String def)
Convenience function to return a value or a default fallback. |
void |
delete(Connection conn,
DatabaseLiaison liaison)
Delete all database entities associated with this value generator. |
void |
init(Connection conn,
DatabaseLiaison liaison)
Ensures the generator is prepared for operation, creating it (only) if necessary. |
boolean |
isPostFactum()
If true, this key generator will be run after the insert statement, if false, it will be run before. |
int |
nextGeneratedValue(Connection conn,
DatabaseLiaison liaison)
Fetch/generate the next primary key value. |
| Methods inherited from class com.samskivert.jdbc.depot.ValueGenerator |
|---|
getDepotMarshaller, getFieldMarshaller, getFieldMaximum |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean _initialized
protected String _valueTable
protected String _pkColumnName
protected String _pkColumnValue
protected String _valueColumnName
| Constructor Detail |
|---|
public TableValueGenerator(TableGenerator tg,
GeneratedValue gv,
DepotMarshaller<?> dm,
FieldMarshaller<?> fm)
| Method Detail |
|---|
public boolean isPostFactum()
ValueGenerator
isPostFactum in class ValueGenerator
public void init(Connection conn,
DatabaseLiaison liaison)
throws SQLException
ValueGenerator
init in class ValueGeneratorSQLException
public void delete(Connection conn,
DatabaseLiaison liaison)
throws SQLException
ValueGenerator
delete in class ValueGeneratorSQLException
public int nextGeneratedValue(Connection conn,
DatabaseLiaison liaison)
throws SQLException
ValueGenerator
nextGeneratedValue in class ValueGeneratorSQLException
protected static String defStr(String value,
String def)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||