|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.avaje.ebean.RawSqlBuilder
public class RawSqlBuilder
Builds RawSql instances from a SQL string and column mappings.
Note that RawSql can also be defined in ebean-orm.xml files and be used as a named query.
RawSql
Field Summary | |
---|---|
static String |
IGNORE_COLUMN
Special property name assigned to a DB column that should be ignored. |
Method Summary | |
---|---|
RawSqlBuilder |
columnMapping(String dbColumn,
String propertyName)
Set the mapping of a DB Column to a bean property. |
RawSqlBuilder |
columnMappingIgnore(String dbColumn)
Ignore this DB column. |
RawSql |
create()
Create the immutable RawSql object. |
static RawSqlBuilder |
parse(String sql)
Return a DRaw parsing the sql. |
static RawSqlBuilder |
unparsed(String sql)
Return an unparsed DRaw. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String IGNORE_COLUMN
Method Detail |
---|
public static RawSqlBuilder unparsed(String sql)
public static RawSqlBuilder parse(String sql)
The sql statement will be parsed so that Ebean can determine where it can insert additional WHERE or HAVING expressions.
Additionally the selected columns are parsed to determine the column ordering. This also means additional checks can be made with the column mapping - specifically we can check that all columns are mapped and that correct column names are entered into the mapping.
public RawSqlBuilder columnMapping(String dbColumn, String propertyName)
For Unparsed SQL the columnMapping MUST be defined in the same order that the columns appear in the SQL statement.
dbColumn
- the DB column that we are mapping to a bean propertypropertyName
- the bean property that we are mapping the DB column to.public RawSqlBuilder columnMappingIgnore(String dbColumn)
public RawSql create()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |