public static final class RawSql.ColumnMapping extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
RawSql.ColumnMapping.Column
A Column of the RawSql that is mapped to a bean property (or ignored).
|
| Modifier | Constructor and Description |
|---|---|
protected |
ColumnMapping()
Construct for unparsed sql.
|
protected |
ColumnMapping(boolean parsed,
LinkedHashMap<String,RawSql.ColumnMapping.Column> dbColumnMap)
Construct an immutable ColumnMapping based on collected information.
|
protected |
ColumnMapping(List<RawSql.ColumnMapping.Column> columns)
Construct from parsed sql where the columns have been identified.
|
protected |
ColumnMapping(String... propertyNames)
Construct for ResultSet use.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
columnMapping(String dbColumn,
String propertyName) |
boolean |
contains(String property)
Return true if the property is mapped.
|
protected RawSql.ColumnMapping |
createImmutableCopy()
Creates an immutable copy of this ColumnMapping.
|
boolean |
equals(Object o) |
Iterator<RawSql.ColumnMapping.Column> |
getColumns()
Return an iterator of the Columns.
|
int |
getIndexPosition(String property)
Return the index position by bean property name.
|
Map<String,String> |
getMapping()
Return the mapping by DB column.
|
int |
hashCode() |
boolean |
isParsed()
Returns true if the Columns where supplied by parsing the sql select
clause.
|
protected Map<String,RawSql.ColumnMapping.Column> |
mapping()
Return the column mapping.
|
int |
size()
Return the number of columns in this column mapping.
|
void |
tableAliasMapping(String tableAlias,
String path)
Modify any column mappings with the given table alias to have the path prefix.
|
protected ColumnMapping(List<RawSql.ColumnMapping.Column> columns)
protected ColumnMapping()
protected ColumnMapping(String... propertyNames)
protected ColumnMapping(boolean parsed, LinkedHashMap<String,RawSql.ColumnMapping.Column> dbColumnMap)
protected RawSql.ColumnMapping createImmutableCopy()
IllegalStateException - when a propertyName has not been defined for a column.protected void columnMapping(String dbColumn, String propertyName)
public boolean isParsed()
In the case where the columns where parsed then we can do extra checks on the column mapping such as, is the column a valid one in the sql and whether all the columns in the sql have been mapped.
public int size()
protected Map<String,RawSql.ColumnMapping.Column> mapping()
public Map<String,String> getMapping()
public int getIndexPosition(String property)
public Iterator<RawSql.ColumnMapping.Column> getColumns()
public void tableAliasMapping(String tableAlias, String path)
For example modify all mappings with table alias "c" to have the path prefix "customer".
For the "Root type" you don't need to specify a tableAliasMapping.
Copyright © 2016. All rights reserved.