|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList
velosurf.context.AttributeReference
public class AttributeReference
Context wrapper for attributes
| Field Summary | |
|---|---|
protected Attribute |
attribute
The wrapped attribute. |
protected java.lang.String |
order
Specified 'order by' clause specified for this attribute reference. |
protected ReadOnlyMap |
readOnlyMap
The data accessor this attribute reference applies to. |
protected java.util.List |
refineCriteria
Specified refining criteria defined on this attribute reference. |
protected UserContext |
userContext
user context |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
AttributeReference(ReadOnlyMap readOnlyMap,
Attribute attribute)
Constructor for attributes |
|
AttributeReference(ReadOnlyMap readOnlyMap,
Attribute attribute,
UserContext usrCtx)
Constructor for attributes |
|
| Method Summary | |
|---|---|
void |
clearRefinement()
Clears any refinement made on this attribute |
java.lang.Object |
get(int i)
Dummy method. |
java.util.List |
getRows()
gets all the rows in a list of maps |
java.util.Iterator |
iterator()
Called by the #foreach directive. |
void |
refine(java.lang.String criterium)
Refines this attribute's reference result : the provided criterium will be added to the 'where' clause (or a 'where' clause will be added). |
void |
setOrder(java.lang.String order)
Specify an 'order by' clause for this attribute reference result. |
int |
size()
Not yet implemented. |
| Methods inherited from class java.util.AbstractList |
|---|
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
| Field Detail |
|---|
protected java.util.List refineCriteria
protected java.lang.String order
protected ReadOnlyMap readOnlyMap
protected Attribute attribute
protected UserContext userContext
| Constructor Detail |
|---|
public AttributeReference(ReadOnlyMap readOnlyMap,
Attribute attribute)
readOnlyMap - the data accessor this attribute reference applies toattribute - the wrapped attribute
public AttributeReference(ReadOnlyMap readOnlyMap,
Attribute attribute,
UserContext usrCtx)
readOnlyMap - the data accessor this attribute reference applies toattribute - the wrapped attribute| Method Detail |
|---|
public void refine(java.lang.String criterium)
This method can be called several times, thus allowing a field-by-field handling of an html search form.
All criteria will be merged with the sql 'and' operator (if there is an initial where clause, it is wrapped into parenthesis).
Example : suppose we have defined the attribute 'person.children' as " *person(person_id):select * from person where parent_id=?". Then, if we issue the following calls from inside the template :
$bob.children.refine("age>18")the resulting query that will be issed is :$bob.children.refine("gender='F'")
select * from person where (parent_id=?) and (age>18) and (gender='F')
criterium - a valid sql conditionpublic void clearRefinement()
public java.util.Iterator iterator()
Returns a RowIterator on all possible instances of this entity, possibly previously refined and ordered.
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Listiterator in class java.util.AbstractList
public java.util.List getRows()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void setOrder(java.lang.String order)
If an 'order by' clause is already present in the original query, the new one is appended (but successive calls to this method overwrite previous ones)
Pass it null or an empty string to clear any ordering.
order - valid sql column names (separated by commas) indicating the
desired orderpublic java.lang.Object get(int i)
get in interface java.util.Listget in class java.util.AbstractListi - ignored
public int size()
size in interface java.util.Collectionsize in interface java.util.Listsize in class java.util.AbstractCollection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||