Package io.ebeaninternal.server.rawsql
Class SpiRawSql.ColumnMapping
- java.lang.Object
-
- io.ebeaninternal.server.rawsql.SpiRawSql.ColumnMapping
-
- All Implemented Interfaces:
Serializable
- Enclosing interface:
- SpiRawSql
public static final class SpiRawSql.ColumnMapping extends Object implements Serializable
Defines the column mapping for raw sql DB columns to bean properties.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SpiRawSql.ColumnMapping.Column
A Column of the RawSql that is mapped to a bean property (or ignored).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(String property)
Return true if the property is mapped.boolean
equals(Object o)
Iterator<SpiRawSql.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.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.
-
-
-
Method Detail
-
isParsed
public boolean isParsed()
Returns true if the Columns where supplied by parsing the sql select clause.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.
-
size
public int size()
Return the number of columns in this column mapping.
-
getMapping
public Map<String,String> getMapping()
Return the mapping by DB column.
-
getIndexPosition
public int getIndexPosition(String property)
Return the index position by bean property name.
-
getColumns
public Iterator<SpiRawSql.ColumnMapping.Column> getColumns()
Return an iterator of the Columns.
-
tableAliasMapping
public void tableAliasMapping(String tableAlias, String path)
Modify any column mappings with the given table alias to have the path prefix.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.
-
-