|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvelosurf.model.Attribute
public class Attribute
This class represents an attribute in the object model
| Field Summary | |
|---|---|
protected Database |
db
database connection |
protected Entity |
entity
parent entity |
protected java.lang.String |
foreignKey
if used, name of the foreign key |
protected java.lang.String |
name
name |
protected 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 |
protected int |
type
attribute type |
static int |
UNDEFINED
constant meaning the return type is undefined |
| Constructor Summary | |
|---|---|
Attribute(java.lang.String name,
Entity entity)
|
|
| Method Summary | |
|---|---|
void |
addParamName(java.lang.String name)
|
java.util.List |
buildArrayList(ReadOnlyMap source)
builds the list of parameter values - do not use directly |
java.lang.Object |
evaluate(ReadOnlyMap source)
evaluate this scalar attribute |
java.lang.Object |
fetch(ReadOnlyMap source)
fetch the row result of this attribute |
Database |
getDB()
gets the database connection |
java.lang.String |
getName()
gets the name of the attribute |
protected java.lang.String |
getQuery()
|
java.lang.String |
getResultEntity()
|
int |
getType()
gets the type of this attribute |
RowIterator |
query(ReadOnlyMap source)
query the resultset for this multivalued attribute |
RowIterator |
query(ReadOnlyMap source,
java.util.List refineCriteria,
java.lang.String order)
query the rowset for this attribute |
void |
setForeignKeyColumn(java.lang.String col)
|
void |
setQuery(java.lang.String query)
|
void |
setResultEntity(java.lang.String entityName)
|
void |
setResultType(int 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
protected java.lang.String name
protected Entity entity
protected java.lang.String resultEntity
protected java.lang.String foreignKey
protected java.util.List<java.lang.String> paramNames
protected java.lang.String query
protected int type
| Constructor Detail |
|---|
public Attribute(java.lang.String name,
Entity entity)
| Method Detail |
|---|
public void setResultType(int type)
public java.lang.String getResultEntity()
public void setResultEntity(java.lang.String entityName)
public void setForeignKeyColumn(java.lang.String col)
public void addParamName(java.lang.String name)
public void setQuery(java.lang.String query)
public java.lang.Object fetch(ReadOnlyMap source)
throws java.sql.SQLException
source - source object
java.sql.SQLException - when thrown by the database
public RowIterator query(ReadOnlyMap source)
throws java.sql.SQLException
source - the source object
java.sql.SQLException - when thrown from the database
public RowIterator query(ReadOnlyMap 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 database
public java.lang.Object evaluate(ReadOnlyMap source)
throws java.sql.SQLException
source - source object
java.sql.SQLException - when thrown from the databasepublic int getType()
public java.util.List buildArrayList(ReadOnlyMap 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()
throws java.sql.SQLException
java.sql.SQLExceptionpublic Database getDB()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||