|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.j_spaces.core.client.SQLQuery com.j_spaces.core.client.ContinousQuery com.j_spaces.core.client.view.View
public class View
TODO add Javadoc
Field Summary |
---|
Fields inherited from class com.j_spaces.core.client.SQLQuery |
---|
CALL, COUNT_PREFIX, DELETE_PREFIX, GROUP, ORDER, SELECT_PREFIX |
Constructor Summary | |
---|---|
View()
Empty constructor. |
|
View(Entry entry,
String sqlQuery)
Constructor for setting the entry as a template to query with the sql query expression. |
|
View(Object object,
String sqlQuery)
Constructor for setting the object as a template to query with the sql query expression. |
|
View(String className,
String sqlQuery)
Constructor for setting the className of the entry to query with the sql query expression. |
Method Summary |
---|
Methods inherited from class com.j_spaces.core.client.SQLQuery |
---|
getClassName, getEntry, getObject, getQuery, hasWhereClause, isExternalEntry, isNullExpression, isStoredProcedure, setClassName, setExternalEntry, setQuery, setTemplate, setTemplate, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public View()
public View(String className, String sqlQuery)
className
- - Entry class name to be queried.sqlQuery
- - The SQL Query expression (contents of the WHERE part).
SQLQuery query = new SQLQuery(MyEntry.class.getName(), "m_integer > 50");
Entry result[] = space.readMultiple(query, null, Integer.MAX_VALUE);
System.out.println("Found " + result.length + " Entries");
for (int i = 0; i < result.length; i++) {
System.out.println(i + " " + (MyEntry) result[i]);
}
public View(Object object, String sqlQuery)
object
- - The POJO to query bysqlQuery
- - The SQL Query expression (contents of the WHERE part).
//let MyEntry extend ExternalEntry
SQLQuery query = new SQLQuery(MyEntry(), "m_integer > 50");
MyEntry result = (MyEntry)space.read(query, null, JavaSpace.NO_WAIT);
if (result!=null)
// if there are more then one, it will return the first entry found
System.out.println("Found entry: " + result.toString());
else
System.out.println("None of the entries match the specified query: "+query);
SQLQuery.SQLQuery(String className, String sqlQuery)
public View(Entry entry, String sqlQuery)
entry
- - The entry to query bysqlQuery
- - The SQL Query expression (contents of the WHERE part).
//let MyEntry extend ExternalEntry
SQLQuery query = new SQLQuery(MyEntry(), "m_integer > 50");
MyEntry result = (MyEntry)space.read(query, null, JavaSpace.NO_WAIT);
if (result!=null)
// if there are more then one, it will return the first entry found
System.out.println("Found entry: " + result.toString());
else
System.out.println("None of the entries match the specified query: "+query);
SQLQuery.SQLQuery(String className, String sqlQuery)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |