TableSequencepublic class TableSequence extends QuerySequence
Fields Summary |
---|
protected static final String | defaultTableNameDefault sequence table name | protected DatabaseTable | tableHold the database table | protected String | counterFieldNameHold the name of the column in the sequence table which specifies the sequence numeric value | protected String | nameFieldNameHold the name of the column in the sequence table which specifies the sequence name | protected String | qualifier |
Constructors Summary |
---|
public TableSequence()
super(false, true);
setTableName(defaultTableName);
| public TableSequence(String name)
super(name, false, true);
setTableName(defaultTableName);
| public TableSequence(String name, int size)
super(name, size, false, true);
setTableName(defaultTableName);
| public TableSequence(String name, int size, int initialValue)
super(name, size, initialValue, false, true);
setTableName(defaultTableName);
| public TableSequence(String name, String tableName)
this(name);
setTableName(tableName);
| public TableSequence(String name, String tableName, String nameFieldName, String counterFieldName)
this(name);
setTableName(tableName);
setNameFieldName(nameFieldName);
setCounterFieldName(counterFieldName);
| public TableSequence(String name, int size, String tableName)
this(name, size);
setTableName(tableName);
| public TableSequence(String name, int size, String tableName, String nameFieldName, String counterFieldName)
this(name, size);
setTableName(tableName);
setNameFieldName(nameFieldName);
setCounterFieldName(counterFieldName);
|
Methods Summary |
---|
protected oracle.toplink.essentials.queryframework.ValueReadQuery | buildSelectQuery()
ValueReadQuery query = new ValueReadQuery();
query.addArgument(getNameFieldName());
StringWriter writer = new StringWriter();
writer.write("SELECT " + getCounterFieldName());
writer.write(" FROM " + getQualifiedTableName());
writer.write(" WHERE " + getNameFieldName());
writer.write(" = #" + getNameFieldName());
query.setSQLString(writer.toString());
return query;
| protected oracle.toplink.essentials.queryframework.DataModifyQuery | buildUpdateQuery()
DataModifyQuery query = new DataModifyQuery();
query.addArgument(getNameFieldName());
query.addArgument("PREALLOC_SIZE");
StringWriter writer = new StringWriter();
writer.write("UPDATE " + getQualifiedTableName());
writer.write(" SET " + getCounterFieldName());
writer.write(" = " + getCounterFieldName());
writer.write(" + #PREALLOC_SIZE");
writer.write(" WHERE " + getNameFieldName() + " = #" + getNameFieldName());
query.setSQLString(writer.toString());
return query;
| public boolean | equals(java.lang.Object obj)
if (obj instanceof TableSequence) {
TableSequence other = (TableSequence)obj;
if (equalNameAndSize(this, other)) {
return getTableName().equals(other.getTableName()) && getCounterFieldName().equals(other.getCounterFieldName()) && getNameFieldName().equals(other.getNameFieldName());
} else {
return false;
}
} else {
return false;
}
| public java.lang.String | getCounterFieldName()
return counterFieldName;
| public java.lang.String | getNameFieldName()
return nameFieldName;
| public java.lang.String | getQualifiedTableName()
if (qualifier.equals("")) {
return getTableName();
} else {
return qualifier + "." + getTableName();
}
| public oracle.toplink.essentials.internal.helper.DatabaseTable | getTable()
return table;
| public java.lang.String | getTableName()
return getTable().getQualifiedName();
| public void | onConnect()INTERNAL:
super.onConnect();
qualifier = getDatasourcePlatform().getTableQualifier();
| public void | onDisconnect()INTERNAL:
qualifier = "";
super.onDisconnect();
| public void | setCounterFieldName(java.lang.String name)
counterFieldName = name;
| public void | setNameFieldName(java.lang.String name)
nameFieldName = name;
| public void | setTable(oracle.toplink.essentials.internal.helper.DatabaseTable table)
this.table = table;
| public void | setTableName(java.lang.String name)
table = new DatabaseTable(name);
|
|