public class IdManagerDefault extends Object implements IIdManager
| Modifier and Type | Field and Description |
|---|---|
protected String |
table
Local table name.
|
protected String |
value
Local value.
|
protected Map<String,Object> |
valuesToIds
Mapping from values to IDs.
|
SEPARATOR| Constructor and Description |
|---|
IdManagerDefault() |
| Modifier and Type | Method and Description |
|---|---|
void |
append(String table,
String value)
Add a table alias to processing.
|
protected void |
bind(Object obj)
Bind value to current context information.
|
protected void |
bind(String value,
Object id)
Bind data to specific mappings.
|
void |
clear()
Clear manager local variables.
|
protected String |
createSelect(Table table)
Create select SQL.
|
Object |
find(String tableOrAlias,
String value,
Column column,
Connection connection,
IStatementFactory statementFactory)
Find a value by its table and alias, or by columns values.
|
boolean |
hasKeys()
Check if manager has keys to read.
|
Object |
lookup(String table,
String value)
Lookup for a ID based on a reference.
|
protected String |
makeKey(String table,
Object value)
Create data key.
|
void |
readKeys(SqlWrapper wrapper,
Table table,
IRegister register,
PreparedStatement pstmt)
Read keys from a prepared statement.
|
void |
reset()
Reset ID manager.
|
protected String table
protected String value
public void reset()
IIdManagerreset in interface IIdManagerpublic void clear()
IIdManagerclear in interface IIdManagerpublic void append(String table, String value)
IIdManagerappend in interface IIdManagertable - Table to append reference value.value - A reference value.public boolean hasKeys()
IIdManagerhasKeys in interface IIdManagerpublic void readKeys(SqlWrapper wrapper, Table table, IRegister register, PreparedStatement pstmt) throws SQLException
IIdManagerreadKeys in interface IIdManagerwrapper - A wrapper.table - A table.register - A register.pstmt - A statement.SQLException - On reading errors.protected void bind(Object obj)
obj - An object.protected void bind(String value, Object id)
value - Value.id - Id value.public Object lookup(String table, String value)
IIdManagerlookup in interface IIdManagertable - Table alias to lookup.value - A object value to transform/recover.protected String makeKey(String table, Object value)
table - Table name.value - Value.public Object find(String tableOrAlias, String value, Column column, Connection connection, IStatementFactory statementFactory) throws DatabaseException, SQLException
IIdManagerfind in interface IIdManagertableOrAlias - Table name.value - The value to be found.column - The reference column.connection - A connection.statementFactory - A statement factory.DatabaseException - On reading errors.SQLException - On select errors.Copyright © 2017. All rights reserved.