Java Doc for VersantQuery.java in  » Testing » PolePosition-0.20 » com » versant » core » jdo » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » PolePosition 0.20 » com.versant.core.jdo 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.versant.core.jdo.VersantQuery

All known Subclasses:   com.versant.core.jdo.VersantQueryImp,
VersantQuery
public interface VersantQuery extends Query(Code)

This interface provides additional Open Access specific query properties. There are two ways to use these properties in your applications:

  1. Cast the Query returned by PersistenceManager.newQuery(...) to a VersantQuery and call the setXXX methods. This is clear in code but non-portable to other JDO implementations.
  2. Add a 'String versantOptions' parameter to the query and specify a semicolon delimited String of property=value pairs when the query is executed. Portability is maintained as other JDO implementations should ignore this parameter.

Example using casting:

 VersantQuery q = (VersantQuery)pm.newQuery(Item.class);
 q.setFetchGroup("codeOnly");
 q.setRandomAccess(true);
 Collection ans = (Collection)q.execute();
 ...
 

Example using versantOptions parameter:

 Query q = pm.newQuery(Item.class);
 q.declareParameters("String versantOptions");
 Collection ans = (Collection)q.execute("fetchGroup=codeOnly;randomAccess=true");
 ...
 


Field Summary
final public static  StringJDO_GENIE_OPTIONS
    
final public static  StringVERSANT_OPTIONS
    


Method Summary
public  Class[]getEvictionClasses()
     Get the registered eviction classes.
public  StringgetFetchGroup()
    
public  intgetFetchSize()
     The number of instances fetched from server per round trip.
public  StringgetFilter()
     Get the filter for the query.
public  StringgetGrouping()
     Get the query grouping expression.
public  StringgetImports()
     Get the query imports.
public  intgetMaxRows()
     The maximum number of instances to return.
public  StringgetOrdering()
     Get the query ordering expression.
public  StringgetParameters()
     Get the query parameter declarations.
public  VersantQueryPlangetPlan(Object[] params)
     Get the query plan for this query.
public  StringgetResult()
     Get the query result expression.
public  StringgetVariables()
     Get the query variable declarations.
public  booleanisBounded()
    
public  booleanisCountStarOnSize()
    
public  booleanisRandomAccess()
    
public  booleanisUnique()
    
public  voidsetBounded(boolean value)
     This property is a hint to JDO Genie that the number of instances returned by the query us limited.
public  voidsetCacheable(boolean on)
     Can the results of the query go into the level 2 cache or come from the level 2 cache? If this property is set then it overrides the default decision.
public  voidsetCountStarOnSize(boolean on)
    

Normally when size() is called on the Collection returned by executing a non-randomAccess Query all of the results are fetched in one operation to detirmine the size of the collection.

public  voidsetEvictionClasses(Class[] classes, boolean includeSubclasses)
    

Register classes that will cause the cached results of this query to be evicted if any of its instances are modified.

public  voidsetEvictionClasses(int[] classIndexes)
     Register the indexes of classes that will cause the cached results of this query to be evicted if any of its instances are modified.
public  voidsetFetchGroup(String fetchGroupName)
     Select the fetch group used to execute the query.
public  voidsetFetchSize(int value)
     Set the number of instances fetched per server round trip.
public  voidsetGrouping(String grouping)
     Grouping exp to use.
public  voidsetMaxRows(int amount)
     Limit the number of instances to be returned.
public  voidsetRandomAccess(boolean on)
     Indicate that random access to query results is required or not.
public  voidsetResult(String result)
     The projection to use.
public  voidsetUnique(boolean unique)
     Specify that there is a single result of the query.

Field Detail
JDO_GENIE_OPTIONS
final public static String JDO_GENIE_OPTIONS(Code)
VersantQuery.VERSANT_OPTIONS



VERSANT_OPTIONS
final public static String VERSANT_OPTIONS(Code)





Method Detail
getEvictionClasses
public Class[] getEvictionClasses()(Code)
Get the registered eviction classes. This does not return classes automatically picked up by JDO Genie (e.g. the candidate class). This may return null if there are no registered eviction classes.
See Also:   VersantQuery.setEvictionClasses(Class[],boolean)
See Also:   VersantQuery.setEvictionClasses(int[])



getFetchGroup
public String getFetchGroup()(Code)



getFetchSize
public int getFetchSize()(Code)
The number of instances fetched from server per round trip.
See Also:   VersantQuery.setFetchSize



getFilter
public String getFilter()(Code)
Get the filter for the query.



getGrouping
public String getGrouping()(Code)
Get the query grouping expression.



getImports
public String getImports()(Code)
Get the query imports.



getMaxRows
public int getMaxRows()(Code)
The maximum number of instances to return.
See Also:   VersantQuery.setMaxRows



getOrdering
public String getOrdering()(Code)
Get the query ordering expression.



getParameters
public String getParameters()(Code)
Get the query parameter declarations.



getPlan
public VersantQueryPlan getPlan(Object[] params)(Code)
Get the query plan for this query. This will include the SQL and possibly also a query plan for the SQL from the database itself. The params are as for executeWithArray.
See Also:   VersantQuery.executeWithArray



getResult
public String getResult()(Code)
Get the query result expression.



getVariables
public String getVariables()(Code)
Get the query variable declarations.



isBounded
public boolean isBounded()(Code)
Has the bounded option been set?
See Also:   VersantQuery.setBounded(boolean)



isCountStarOnSize
public boolean isCountStarOnSize()(Code)
Has the count(*) option been set?
See Also:   VersantQuery.setCountStarOnSize(boolean)



isRandomAccess
public boolean isRandomAccess()(Code)



isUnique
public boolean isUnique()(Code)
Has the unique flag been set?



setBounded
public void setBounded(boolean value)(Code)
This property is a hint to JDO Genie that the number of instances returned by the query us limited. If it is true then collections and maps are fetched in bulk using parallel queries derived from the orginal filter expression. If it is false then individual queries are issued for each collection or map for each instance in the result. The default setting is false.



setCacheable
public void setCacheable(boolean on)(Code)
Can the results of the query go into the level 2 cache or come from the level 2 cache? If this property is set then it overrides the default decision. Normally JDOQL query results are added to the level 2 cache if all classes involved have a cache strategy of yes or all. SQL query results are not normally cached.

You might want to use this for a large JDOQL query if you know that caching the results will not benefit the application. Or you could use it to cache the results of an SQL query.
See Also:   VersantQuery.setEvictionClasses(int[])




setCountStarOnSize
public void setCountStarOnSize(boolean on)(Code)

Normally when size() is called on the Collection returned by executing a non-randomAccess Query all of the results are fetched in one operation to detirmine the size of the collection. If this property is true then a 'select count(*) ...' version of the query is used to count the results. Subsequent calls to to size() after the first call will revert to normal behaviour and resolve all of the results.

Note that the actual number of results might differ to those first returned by size() when this option is used. This can happen if new rows that meet the filter criteria are inserted after the 'select count(*)...' query has run but before the normal 'select ...' to fetch the data. This may be possible even in a non-optimistic transaction depending on how the database handles locking.


See Also:   VersantQuery.setRandomAccess(boolean)
See Also:   VersantQuery.isCountStarOnSize()



setEvictionClasses
public void setEvictionClasses(Class[] classes, boolean includeSubclasses)(Code)

Register classes that will cause the cached results of this query to be evicted if any of its instances are modified. These replace any previously set classes. JDO Genie will automatically pickup the candidate class and classes involved in the filter or ordering. You only need to call this method if you are using inline SQL to touch tables for classes not otherwise involved in the query. Here is an example:

Query q = pm.newQuery(Order.class);
String aclCheck = "$1 in (select $1 from acl where user_id = " + userId + ")";
q.setFilter("owner.sql(\"" + aclCheck + "\")");
((VersantQuery)q).setEvictionClasses(new[]{Acl.class}, true);
// make sure query result is evicted if acl table(class) changes
...

Parameters:
  includeSubclasses - Recursively add subclasses (if any)
See Also:   VersantQuery.setEvictionClasses(int[])




setEvictionClasses
public void setEvictionClasses(int[] classIndexes)(Code)
Register the indexes of classes that will cause the cached results of this query to be evicted if any of its instances are modified. This performs the same function as the method accepting a Class[] but is faster as the index for each class does not have to be found.
See Also:   VersantQuery.setEvictionClasses(Class[],boolean)
See Also:   com.versant.core.jdo.VersantPersistenceManagerFactory.getClassIndexes(Class[]boolean)



setFetchGroup
public void setFetchGroup(String fetchGroupName)(Code)
Select the fetch group used to execute the query. JDO Genie fetch groups control exactly which fields are returned in each instance. They also make it possible to fetch other referenced instances and collections at the same time i.e. you can prefetch a large part of your object graph with a single query.



setFetchSize
public void setFetchSize(int value)(Code)
Set the number of instances fetched per server round trip. This property controls JDO Genie's own batching and is also passed through to JDBC drivers that support this. If this property is not set and maxRows is set then the default is maxRows.
See Also:   VersantQuery.getFetchSize



setGrouping
public void setGrouping(String grouping)(Code)
Grouping exp to use. This is used in conjunction with projection queries.
See Also:   VersantQuery.setResult(java.lang.String)



setMaxRows
public void setMaxRows(int amount)(Code)
Limit the number of instances to be returned. If this property has been set and VersantQuery.setFetchSize is not set then the batchSize is set to maxRows.
See Also:   VersantQuery.setFetchSize
See Also:   VersantQuery.getMaxRows



setRandomAccess
public void setRandomAccess(boolean on)(Code)
Indicate that random access to query results is required or not. If this is true then the collection returned by execute can be cast to a List and the get(index) method can be used to get any entry in the list. JDO Genie must use a scrollable JDBC ResultSet to provide this functionality. This may use more database resources (cursors etc.) than a normal forward only ResultSet. This option is useful for paged results i.e. you only want a few results from position n onwards.



setResult
public void setResult(String result)(Code)
The projection to use.



setUnique
public void setUnique(boolean unique)(Code)
Specify that there is a single result of the query.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.