|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object velosurf.model.Attribute
public class Attribute
This class represents an attribute in the object model.
Field Summary | |
---|---|
private boolean |
caching
Caching |
protected Database |
db
Database connection. |
protected Entity |
entity
Parent entity. |
private java.lang.String |
foreignKey
Deprecated. |
private java.lang.String |
name
Name. |
private java.util.List<java.lang.String> |
paramNames
List of the parameter names. |
protected java.lang.String |
query
Attribute query. |
protected java.lang.String |
resultEntity
For row and rowset attributes, the resulting entity (if specified). |
static int |
ROW
Constant meaning the result is a single row. |
static int |
ROWSET
Constant meaning the result is a rowset. |
static int |
SCALAR
Constant meaning the result is a scalar. |
private int |
type
Attribute type. |
static int |
UNDEFINED
Constant meaning the return type is undefined. |
Constructor Summary | |
---|---|
Attribute(java.lang.String name,
Entity entity)
Constructor. |
Method Summary | |
---|---|
void |
addParamName(java.lang.String name)
Adds a parameter name. |
private java.util.List<java.lang.Object> |
buildArrayList(java.util.Map<java.lang.String,java.lang.Object> source)
Builds the list of parameter values. |
java.lang.Object |
evaluate(java.util.Map<java.lang.String,java.lang.Object> source)
Evaluate this scalar attribute. |
java.lang.Object |
fetch(java.util.Map<java.lang.String,java.lang.Object> source)
Fetch a row. |
boolean |
getCaching()
Gets caching state |
Database |
getDB()
Gets the database connection. |
Entity |
getEntity()
Gets the parent entity |
java.lang.String |
getName()
Gets the name of this attribute. |
protected java.lang.String |
getQuery()
|
java.lang.String |
getResultEntity()
Gets the result type. |
int |
getType()
Get the type of this attribute. |
RowIterator |
query(java.util.Map<java.lang.String,java.lang.Object> source)
Query the resultset for this multivalued attribute. |
RowIterator |
query(java.util.Map<java.lang.String,java.lang.Object> source,
java.util.List refineCriteria,
java.lang.String order)
Query the rowset for this attribute. |
void |
setCaching(boolean c)
Sets caching on or off |
void |
setForeignKeyColumn(java.lang.String col)
Deprecated. since Velosurf 2.0. Use a <imported-key> tag instead. |
void |
setQuery(java.lang.String query)
Sets the query. |
void |
setResultEntity(java.lang.String entityName)
Sets the result entity. |
void |
setResultType(int type)
Sets the result type. |
java.lang.String |
toString()
Debug method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int UNDEFINED
public static final int ROW
public static final int ROWSET
public static final int SCALAR
protected Database db
private java.lang.String name
protected Entity entity
protected java.lang.String resultEntity
private java.lang.String foreignKey
private java.util.List<java.lang.String> paramNames
protected java.lang.String query
private int type
private boolean caching
Constructor Detail |
---|
public Attribute(java.lang.String name, Entity entity)
name
- name of this attributeentity
- parent entityMethod Detail |
---|
public void setResultType(int type)
type
- public Entity getEntity()
public java.lang.String getResultEntity()
public void setResultEntity(java.lang.String entityName)
entityName
- the name of the result entity.public void setForeignKeyColumn(java.lang.String col)
col
- the foreign-key column.public void addParamName(java.lang.String name)
name
- name of a parameter.public void setQuery(java.lang.String query)
query
- this attribute's querypublic java.lang.Object fetch(java.util.Map<java.lang.String,java.lang.Object> source) throws java.sql.SQLException
source
- source object
java.sql.SQLException
- when thrown by the databasepublic RowIterator query(java.util.Map<java.lang.String,java.lang.Object> source) throws java.sql.SQLException
source
- the source object
java.sql.SQLException
- when thrown from the databasepublic RowIterator query(java.util.Map<java.lang.String,java.lang.Object> source, java.util.List refineCriteria, java.lang.String order) throws java.sql.SQLException
source
- source objectrefineCriteria
- refine criteriaorder
- order clause
java.sql.SQLException
- when thrown by the databasepublic java.lang.Object evaluate(java.util.Map<java.lang.String,java.lang.Object> source) throws java.sql.SQLException
source
- source object
java.sql.SQLException
- when thrown from the databasepublic int getType()
private java.util.List<java.lang.Object> buildArrayList(java.util.Map<java.lang.String,java.lang.Object> source) throws java.sql.SQLException
source
- source object
java.sql.SQLException
- thrown by the database enginepublic java.lang.String getName()
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String getQuery()
public Database getDB()
public boolean getCaching()
public void setCaching(boolean c)
c
- caching state
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |