Java Doc for Relation.java in  » Web-Framework » helma » helma » objectmodel » db » 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 » Web Framework » helma » helma.objectmodel.db 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   helma.objectmodel.db.Relation

Relation
final public class Relation (Code)
This describes how a property of a persistent Object is stored in a relational database table. This can be either a scalar property (string, date, number etc.) or a reference to one or more other objects.

Inner Class :class Constraint

Field Summary
final public static  StringAND
    
final public static  intCOLLECTION
    
final public static  intCOMPLEX_REFERENCE
    
final public static  intINVALID
    
final static  StringJOIN_PREFIX
    
final public static  StringOR
    
final public static  intPRIMITIVE
    
final public static  intREFERENCE
    
final public static  StringXOR
    
 StringaccessName
    
 booleanaggressiveCaching
    
 booleanaggressiveLoading
    
 booleanautoSorted
    
 StringcolumnName
    
 intcolumnType
    
 Constraint[]constraints
    
 Stringfilter
    
 VectorfilterFragments
    
 VectorfilterPropertyRefs
    
 Stringgroupby
    
 StringgroupbyOrder
    
 StringgroupbyPrototype
    
 booleanisPrivate
    
 intmaxSize
    
 Stringorder
    
 DbMappingotherType
    
 DbMappingownType
    
 StringpropName
    
 Stringprototype
    
 StringqueryHints
    
 booleanreadonly
    
 booleanreferencesPrimaryKey
    
 intreftype
    
 StringupdateCriteria
    
 booleanvirtual
    
 DbMappingvirtualMapping
    

Constructor Summary
public  Relation(String propName, DbMapping ownType)
     Reads a relation entry from a line in a properties file.

Method Summary
protected  voidaddConstraint(Constraint c)
    
protected  voidappendAdditionalTables(StringBuffer q)
    
protected  voidappendFilter(StringBuffer q, INode nonvirtual, String prefix)
     Build the filter.
public  StringbuildQuery(INode home, INode nonvirtual, String kstr, String pre, boolean useOrder)
     Build the second half of an SQL select statement according to this relation and a local object.
public  StringbuildQuery(INode home, INode nonvirtual, DbMapping otherDbm, String kstr, String pre, boolean useOrder)
     Build the second half of an SQL select statement according to this relation and a local object.
public  booleancheckConstraints(Node parent, Node child)
     Check if the child node fullfills the constraints defined by this relation.
public  intcountConstraints()
     Returns the number of constraints for this relation.
public  booleancreateOnDemand()
     Returns true if the object represented by this Relation has to be created on demand at runtime by the NodeManager.
public  StringgetAccessName()
    
public  intgetColumnType()
    
public  ResourcePropertiesgetConfig()
     Get the configuration properties for this relation.
public  StringgetDbField()
     Return the local field name for updates.
public  StringgetGroup()
     Get the group for a collection relation, if defined.
 RelationgetGroupbyPropertyRelation()
     Return a Relation that defines the properties of a group-by node.
 RelationgetGroupbySubnodeRelation()
     Return a Relation that defines the subnodes of a group-by node.
public  MapgetKeyParts(INode home)
    
public  StringgetOrder()
    
public  StringgetPropName()
    
public  DbMappinggetPropertyMapping()
     Return the db mapping for a propery relation.
public  StringgetPrototype()
    
public  intgetRefType()
     Get the reference type of this relation.
public  RelationgetSubnodeRelation()
    
public  DbMappinggetTargetType()
     Return the target type of this relation, or null if this is a primitive mapping.
public  DbMappinggetVirtualMapping()
     get a DbMapping to use for virtual aka collection nodes.
 RelationgetVirtualPropertyRelation()
     Return a Relation that defines the properties of a virtual node.
 RelationgetVirtualSubnodeRelation()
     Return a Relation that defines the subnodes of a virtual node.
public  booleanhasAccessName()
    
public  booleanisCollection()
     Returns true if this Relation describes a collection.
public  booleanisComplexReference()
    
public  booleanisPrimitive()
     Tell if this relation represents a primitive (scalar) value mapping.
public  booleanisPrimitiveOrReference()
     Returns true if this Relation describes either a primitive value or an object reference.
public  booleanisPrivate()
     Tell wether the property described by this relation is to be handled as private, i.e.
public  booleanisReadonly()
     Tell wether the property described by this relation is to be handled as readonly/write protected.
public  booleanisReference()
    
public  booleanisVirtual()
    
public  booleanloadAggressively()
    
public  booleanneedsPersistence()
     Returns true if the object represented by this Relation has to be persisted in the internal db in order to be functional.
protected  voidparseOptions(Vector cnst, Properties config)
    
protected  voidparsePropertyString(String value, Vector fragments, Vector propertyRefs)
     This is taken from org.apache.tools.ant ProjectHelper.java distributed under the Apache Software License, Version 1.1 Parses a string containing ${xxx} style property references into two lists.
public  voidrenderConstraints(StringBuffer q, INode home, INode nonvirtual, String prefix)
     Render contraints and filter conditions to an SQL query string buffer.
Parameters:
  q - the query string
Parameters:
  home - our home node
Parameters:
  nonvirtual - our non-virtual home node
Parameters:
  prefix - the prefix to use to append to the existing query (e.g.
public  voidrenderConstraints(StringBuffer q, INode home, INode nonvirtual, DbMapping otherDbm, String prefix)
     Render contraints and filter conditions to an SQL query string buffer.
Parameters:
  q - the query string
Parameters:
  home - our home node
Parameters:
  nonvirtual - our non-virtual home nod
Parameters:
  otherDbm - the DbMapping of the remote Node
Parameters:
  prefix - the prefix to use to append to the existing query (e.g.
public  voidrenderJoinConstraints(StringBuffer select, boolean isOracle)
     Render the constraints for this relation for use within a left outer join select statement for the base object.
public  voidsetColumnType(int ct)
    
public  voidsetConstraints(Node parent, Node child)
    
public  StringtoString()
    
public  voidunsetConstraints(Node parent, INode child)
     Unset the constraints that link two objects together.
public  voidupdate(String desc, ResourceProperties props)
    
public  booleanusesPrimaryKey()
    

Field Detail
AND
final public static String AND(Code)



COLLECTION
final public static int COLLECTION(Code)



COMPLEX_REFERENCE
final public static int COMPLEX_REFERENCE(Code)



INVALID
final public static int INVALID(Code)



JOIN_PREFIX
final static String JOIN_PREFIX(Code)



OR
final public static String OR(Code)



PRIMITIVE
final public static int PRIMITIVE(Code)



REFERENCE
final public static int REFERENCE(Code)



XOR
final public static String XOR(Code)



accessName
String accessName(Code)



aggressiveCaching
boolean aggressiveCaching(Code)



aggressiveLoading
boolean aggressiveLoading(Code)



autoSorted
boolean autoSorted(Code)



columnName
String columnName(Code)



columnType
int columnType(Code)



constraints
Constraint[] constraints(Code)



filter
String filter(Code)



filterFragments
Vector filterFragments(Code)



filterPropertyRefs
Vector filterPropertyRefs(Code)



groupby
String groupby(Code)



groupbyOrder
String groupbyOrder(Code)



groupbyPrototype
String groupbyPrototype(Code)



isPrivate
boolean isPrivate(Code)



maxSize
int maxSize(Code)



order
String order(Code)



otherType
DbMapping otherType(Code)



ownType
DbMapping ownType(Code)



propName
String propName(Code)



prototype
String prototype(Code)



queryHints
String queryHints(Code)



readonly
boolean readonly(Code)



referencesPrimaryKey
boolean referencesPrimaryKey(Code)



reftype
int reftype(Code)



updateCriteria
String updateCriteria(Code)



virtual
boolean virtual(Code)



virtualMapping
DbMapping virtualMapping(Code)




Constructor Detail
Relation
public Relation(String propName, DbMapping ownType)(Code)
Reads a relation entry from a line in a properties file.




Method Detail
addConstraint
protected void addConstraint(Constraint c)(Code)
Add a constraint to the current list of constraints



appendAdditionalTables
protected void appendAdditionalTables(StringBuffer q)(Code)



appendFilter
protected void appendFilter(StringBuffer q, INode nonvirtual, String prefix)(Code)
Build the filter.



buildQuery
public String buildQuery(INode home, INode nonvirtual, String kstr, String pre, boolean useOrder) throws SQLException, ClassNotFoundException(Code)
Build the second half of an SQL select statement according to this relation and a local object.



buildQuery
public String buildQuery(INode home, INode nonvirtual, DbMapping otherDbm, String kstr, String pre, boolean useOrder) throws SQLException, ClassNotFoundException(Code)
Build the second half of an SQL select statement according to this relation and a local object.



checkConstraints
public boolean checkConstraints(Node parent, Node child)(Code)
Check if the child node fullfills the constraints defined by this relation. FIXME: This always returns false if the relation has a filter value set, since we can't determine if the filter constraints are met without querying the database.
Parameters:
  parent - the parent object - may be a virtual or group node
Parameters:
  child - the child object true if all constraints are met



countConstraints
public int countConstraints()(Code)
Returns the number of constraints for this relation.



createOnDemand
public boolean createOnDemand()(Code)
Returns true if the object represented by this Relation has to be created on demand at runtime by the NodeManager. This is true for: - collection (aka virtual) nodes - nodes accessed via accessname - group nodes - complex reference nodes



getAccessName
public String getAccessName()(Code)
...



getColumnType
public int getColumnType()(Code)
...



getConfig
public ResourceProperties getConfig()(Code)
Get the configuration properties for this relation.



getDbField
public String getDbField()(Code)
Return the local field name for updates.



getGroup
public String getGroup()(Code)
Get the group for a collection relation, if defined. the name of the column used to group child objects, if any.



getGroupbyPropertyRelation
Relation getGroupbyPropertyRelation()(Code)
Return a Relation that defines the properties of a group-by node.



getGroupbySubnodeRelation
Relation getGroupbySubnodeRelation()(Code)
Return a Relation that defines the subnodes of a group-by node.



getKeyParts
public Map getKeyParts(INode home)(Code)
Returns a map containing the key/value pairs for a specific Node



getOrder
public String getOrder()(Code)
Get the order section to use for this relation



getPropName
public String getPropName()(Code)
Return the name of the local property this relation is defined for



getPropertyMapping
public DbMapping getPropertyMapping()(Code)
Return the db mapping for a propery relation. the target mapping of this property relation



getPrototype
public String getPrototype()(Code)
Return the prototype to be used for object reached by this relation



getRefType
public int getRefType()(Code)
Get the reference type of this relation.



getSubnodeRelation
public Relation getSubnodeRelation()(Code)
...



getTargetType
public DbMapping getTargetType()(Code)
Return the target type of this relation, or null if this is a primitive mapping.



getVirtualMapping
public DbMapping getVirtualMapping()(Code)
get a DbMapping to use for virtual aka collection nodes.



getVirtualPropertyRelation
Relation getVirtualPropertyRelation()(Code)
Return a Relation that defines the properties of a virtual node.



getVirtualSubnodeRelation
Relation getVirtualSubnodeRelation()(Code)
Return a Relation that defines the subnodes of a virtual node.



hasAccessName
public boolean hasAccessName()(Code)
...



isCollection
public boolean isCollection()(Code)
Returns true if this Relation describes a collection. NOTE: this will return true both for collection objects (aka virtual nodes) and direct child object relations, so isVirtual() should be used to identify relations that define collection properties!



isComplexReference
public boolean isComplexReference()(Code)
Returns true if this Relation describes a complex object reference property



isPrimitive
public boolean isPrimitive()(Code)
Tell if this relation represents a primitive (scalar) value mapping.



isPrimitiveOrReference
public boolean isPrimitiveOrReference()(Code)
Returns true if this Relation describes either a primitive value or an object reference.



isPrivate
public boolean isPrivate()(Code)
Tell wether the property described by this relation is to be handled as private, i.e. a change on it should not result in any changed object/collection relations.



isReadonly
public boolean isReadonly()(Code)
Tell wether the property described by this relation is to be handled as readonly/write protected.



isReference
public boolean isReference()(Code)
Returns true if this Relation describes an object reference property



isVirtual
public boolean isVirtual()(Code)
Does this relation describe a virtual (collection) node?



loadAggressively
public boolean loadAggressively()(Code)
Check whether aggressive loading is set for this relation



needsPersistence
public boolean needsPersistence()(Code)
Returns true if the object represented by this Relation has to be persisted in the internal db in order to be functional. This is true if the subnodes contained in this collection are stored in the embedded database. In this case, the collection itself must also be an ordinary object stored in the db, since a virtual collection would lose its its content after restarts.



parseOptions
protected void parseOptions(Vector cnst, Properties config)(Code)



parsePropertyString
protected void parsePropertyString(String value, Vector fragments, Vector propertyRefs)(Code)
This is taken from org.apache.tools.ant ProjectHelper.java distributed under the Apache Software License, Version 1.1 Parses a string containing ${xxx} style property references into two lists. The first list is a collection of text fragments, while the other is a set of string property names. null entries in the first list indicate a property reference from the second list.
Parameters:
  value - Text to parse. Must not be null.
Parameters:
  fragments - List to add text fragments to.Must not be null.
Parameters:
  propertyRefs - List to add property names to.Must not be null.



renderConstraints
public void renderConstraints(StringBuffer q, INode home, INode nonvirtual, String prefix) throws SQLException, ClassNotFoundException(Code)
Render contraints and filter conditions to an SQL query string buffer.
Parameters:
  q - the query string
Parameters:
  home - our home node
Parameters:
  nonvirtual - our non-virtual home node
Parameters:
  prefix - the prefix to use to append to the existing query (e.g. " AND ")
throws:
  SQLException - sql related exception
throws:
  ClassNotFoundException - driver class not found



renderConstraints
public void renderConstraints(StringBuffer q, INode home, INode nonvirtual, DbMapping otherDbm, String prefix) throws SQLException, ClassNotFoundException(Code)
Render contraints and filter conditions to an SQL query string buffer.
Parameters:
  q - the query string
Parameters:
  home - our home node
Parameters:
  nonvirtual - our non-virtual home nod
Parameters:
  otherDbm - the DbMapping of the remote Node
Parameters:
  prefix - the prefix to use to append to the existing query (e.g. " AND ")
throws:
  SQLException - sql related exception
throws:
  ClassNotFoundException - driver class not found



renderJoinConstraints
public void renderJoinConstraints(StringBuffer select, boolean isOracle)(Code)
Render the constraints for this relation for use within a left outer join select statement for the base object.
Parameters:
  select - the string buffer to write to
Parameters:
  isOracle - create Oracle pre-9 style left outer join



setColumnType
public void setColumnType(int ct)(Code)

Parameters:
  ct - ...



setConstraints
public void setConstraints(Node parent, Node child)(Code)
Make sure that the child node fullfills the constraints defined by this relation by setting the appropriate properties



toString
public String toString()(Code)
...



unsetConstraints
public void unsetConstraints(Node parent, INode child)(Code)
Unset the constraints that link two objects together.



update
public void update(String desc, ResourceProperties props)(Code)



usesPrimaryKey
public boolean usesPrimaryKey()(Code)
true if the foreign key used for this relation is theother object's primary key.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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