Java Doc for AbstractContainerMapping.java in  » Database-ORM » JPOX » org » jpox » store » mapping » 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 » Database ORM » JPOX » org.jpox.store.mapping 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jpox.store.mapping.JavaTypeMapping
      org.jpox.store.mapping.SingleFieldMapping
         org.jpox.store.mapping.AbstractContainerMapping

All known Subclasses:   org.jpox.store.mapping.MapMapping,  org.jpox.store.mapping.ArrayMapping,  org.jpox.store.mapping.CollectionMapping,
AbstractContainerMapping
abstract public class AbstractContainerMapping extends SingleFieldMapping (Code)
Mapping for a field that represents a container of objects, such as a List, a Set, a Collection, a Map, or an array. Has an owner table. Can be represented in the following ways :-
  • Using a Join-Table, where the linkage between owner and elements/keys/values is stored in this table
  • Using a Foreign-Key in the element/key/value
  • Serialised into a single column in the owner table.
  • Embedded into the Join-Table
  • Serialised into a single-column in the Join-Table
The contents of the container are backed by a store, handling interfacing with the datastore.
version:
   $Revision: 1.50 $


Field Summary
protected  StringfieldName
     Name of the field that is the container.
protected  StoreManagerstoreMgr
     Store Manager being used.


Method Summary
protected  booleancontainerIsStoredInSingleColumn()
     Convenience method to return if the container (collection or map) is stored in the owning table as a column.
public  DatastoreMappinggetDataStoreMapping(int index)
    
public  DatastoreMapping[]getDataStoreMappings()
    
public  DatastoreContainerObjectgetDatastoreContainer()
     Accessor for the datastore class.
public  StringgetJavaTypeForDatastoreMapping(int index)
     Accessor for the name of the java-type actually used when mapping the particular datastore field.
public  intgetNumberOfDatastoreFields()
    
public  ObjectgetObject(ObjectManager om, Object resultSet, int[] exprIndex)
     Method to retrieve an object from the passed JDBC ResultSet.
public  ObjectgetSampleValue(ClassLoaderResolver clr)
     Accessor for a sample value for this mapping.
public  inthashCode()
     Hash code function.
public  booleanincludeInFetchStatement()
     This mapping is included in the select statement.
public  booleanincludeInInsertStatement()
     This mapping is included in the insert statement.
public  booleanincludeInUpdateStatement()
     This mapping is included in the update statement.
public  voidinitialize(DatastoreAdapter dba, AbstractMemberMetaData fmd, DatastoreContainerObject container, ClassLoaderResolver clr)
     Initialize this JavaTypeMapping with the given DatastoreAdapter for the given FieldMetaData.
public  voidpostFetch(StateManager sm)
     Method to be called after any fetch of the owner class element.
protected  voidprepareDatastoreMapping()
     Method to prepare a field mapping for use in the datastore.
protected  SCOreplaceFieldWithWrapper(StateManager ownerSM, Object value, boolean forInsert, boolean forUpdate)
     Method to replace the field that this mapping represents with a SCO wrapper.
public  voidsetObject(ObjectManager om, Object preparedStatement, int[] exprIndex, Object value)
     Method to set a field in the passed JDBC PreparedStatement using this mapping.

Field Detail
fieldName
protected String fieldName(Code)
Name of the field that is the container.



storeMgr
protected StoreManager storeMgr(Code)
Store Manager being used.





Method Detail
containerIsStoredInSingleColumn
protected boolean containerIsStoredInSingleColumn()(Code)
Convenience method to return if the container (collection or map) is stored in the owning table as a column. The container is stored in a single column in the following situations :-
  • The FieldMetaData has 'serialized="true"'
  • The collection has embedded-element="true" but no join table (and so serialised)
  • The map has embedded-key/value="true" but no join table (and so serialised)
  • The array has embedded-element="true" but no join table (and so serialised)
  • The array has no join table and non-PC elements (and so serialised)
Whether it is stored in a single column in the main table.



getDataStoreMapping
public DatastoreMapping getDataStoreMapping(int index)(Code)
Accessor for a datastore mapping
Parameters:
  index - The id of the mapping The datastore mapping



getDataStoreMappings
public DatastoreMapping[] getDataStoreMappings()(Code)
Accessor for the datastore mappings for this java type The datastore mapping(s)



getDatastoreContainer
public DatastoreContainerObject getDatastoreContainer()(Code)
Accessor for the datastore class. The datastore class



getJavaTypeForDatastoreMapping
public String getJavaTypeForDatastoreMapping(int index)(Code)
Accessor for the name of the java-type actually used when mapping the particular datastore field. This java-type must have an entry in the datastore mappings.
Parameters:
  index - requested datastore field index. the name of java-type for the requested datastore field.



getNumberOfDatastoreFields
public int getNumberOfDatastoreFields()(Code)
Accessor for the number of datastore fields The number of datastore fields



getObject
public Object getObject(ObjectManager om, Object resultSet, int[] exprIndex)(Code)
Method to retrieve an object from the passed JDBC ResultSet. Only valid when the collection is serialised.
Parameters:
  om - Object Manager
Parameters:
  resultSet - The JDBC ResultSet
Parameters:
  exprIndex - The JDBC parameter position(s) to extract the object from The collection object



getSampleValue
public Object getSampleValue(ClassLoaderResolver clr)(Code)
Accessor for a sample value for this mapping. The sample value



hashCode
public int hashCode()(Code)
Hash code function. The hash code for this object



includeInFetchStatement
public boolean includeInFetchStatement()(Code)
This mapping is included in the select statement. Whether to include in select statement



includeInInsertStatement
public boolean includeInInsertStatement()(Code)
This mapping is included in the insert statement. Whether to include in insert statement



includeInUpdateStatement
public boolean includeInUpdateStatement()(Code)
This mapping is included in the update statement. Whether to include in update statement



initialize
public void initialize(DatastoreAdapter dba, AbstractMemberMetaData fmd, DatastoreContainerObject container, ClassLoaderResolver clr)(Code)
Initialize this JavaTypeMapping with the given DatastoreAdapter for the given FieldMetaData.
Parameters:
  dba - The Datastore Adapter that this Mapping should use.
Parameters:
  fmd - FieldMetaData for the field to be mapped (if any)
Parameters:
  container - The datastore container storing this mapping (if any)
Parameters:
  clr - the ClassLoaderResolver



postFetch
public void postFetch(StateManager sm)(Code)
Method to be called after any fetch of the owner class element.
Parameters:
  sm - StateManager of the owner



prepareDatastoreMapping
protected void prepareDatastoreMapping()(Code)
Method to prepare a field mapping for use in the datastore. This creates the column in the table.



replaceFieldWithWrapper
protected SCO replaceFieldWithWrapper(StateManager ownerSM, Object value, boolean forInsert, boolean forUpdate)(Code)
Method to replace the field that this mapping represents with a SCO wrapper. The wrapper will be suitable for the passed instantiated type and if it is null will be for the declared type of the field.
Parameters:
  ownerSM - State Manager for the owning object
Parameters:
  value - The value to create the wrapper with
Parameters:
  forInsert - Whether to insert the SCO with this value
Parameters:
  forUpdate - Whether to update the SCO with this value The SCO wrapper object that the field was replaced with



setObject
public void setObject(ObjectManager om, Object preparedStatement, int[] exprIndex, Object value)(Code)
Method to set a field in the passed JDBC PreparedStatement using this mapping. Only valid when the collection is serialised.
Parameters:
  om - The Object Manager
Parameters:
  preparedStatement - The JDBC Prepared Statement to be populated
Parameters:
  exprIndex - The parameter positions in the JDBC statement to populate.
Parameters:
  value - The value to populate into it



Methods inherited from org.jpox.store.mapping.SingleFieldMapping
public boolean equals(Object obj)(Code)(Java Doc)
public boolean getBoolean(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc)
public byte getByte(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc)
public char getChar(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc)
public int getDefaultLength(int index)(Code)(Java Doc)
public double getDouble(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc)
public float getFloat(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc)
public int getInt(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc)
public String getJavaTypeForDatastoreMapping(int index)(Code)(Java Doc)
public long getLong(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc)
public Object getObject(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc)
public short getShort(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc)
public String getString(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc)
public ScalarExpression[] getValidValues(int index)(Code)(Java Doc)
public void initialize(DatastoreAdapter dba, AbstractMemberMetaData fmd, DatastoreContainerObject container, ClassLoaderResolver clr)(Code)(Java Doc)
protected void prepareDatastoreMapping()(Code)(Java Doc)
public void setBoolean(ObjectManager om, Object preparedStatement, int[] exprIndex, boolean value)(Code)(Java Doc)
public void setByte(ObjectManager om, Object preparedStatement, int[] exprIndex, byte value)(Code)(Java Doc)
public void setChar(ObjectManager om, Object preparedStatement, int[] exprIndex, char value)(Code)(Java Doc)
public void setDouble(ObjectManager om, Object preparedStatement, int[] exprIndex, double value)(Code)(Java Doc)
public void setFloat(ObjectManager om, Object preparedStatement, int[] exprIndex, float value)(Code)(Java Doc)
public void setInt(ObjectManager om, Object preparedStatement, int[] exprIndex, int value)(Code)(Java Doc)
public void setLong(ObjectManager om, Object preparedStatement, int[] exprIndex, long value)(Code)(Java Doc)
public void setObject(ObjectManager om, Object preparedStatement, int[] exprIndex, Object value)(Code)(Java Doc)
public void setShort(ObjectManager om, Object preparedStatement, int[] exprIndex, short value)(Code)(Java Doc)
public void setString(ObjectManager om, Object preparedStatement, int[] exprIndex, String value)(Code)(Java Doc)

Fields inherited from org.jpox.store.mapping.JavaTypeMapping
final protected static Localiser LOCALISER(Code)(Java Doc)
final public static int MAPPING_ARRAY_ELEMENT(Code)(Java Doc)
final public static int MAPPING_COLLECTION_ELEMENT(Code)(Java Doc)
final public static int MAPPING_FIELD(Code)(Java Doc)
final public static int MAPPING_MAP_KEY(Code)(Java Doc)
final public static int MAPPING_MAP_VALUE(Code)(Java Doc)
protected DatastoreContainerObject datastoreContainer(Code)(Java Doc)
protected DatastoreMapping[] datastoreMappings(Code)(Java Doc)
protected DatastoreAdapter dba(Code)(Java Doc)
protected AbstractMemberMetaData fmd(Code)(Java Doc)
protected JavaTypeMapping referenceMapping(Code)(Java Doc)
protected int roleForField(Code)(Java Doc)
protected String type(Code)(Java Doc)

Methods inherited from org.jpox.store.mapping.JavaTypeMapping
public void addDataStoreMapping(DatastoreMapping datastoreMapping)(Code)(Java Doc)
protected String failureMessage(String method)(Code)(Java Doc)
public boolean getBoolean(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc)
public byte getByte(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc)
public char getChar(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc)
public DatastoreMapping getDataStoreMapping(int index)(Code)(Java Doc)
public DatastoreMapping[] getDataStoreMappings()(Code)(Java Doc)
public DatastoreContainerObject getDatastoreContainer()(Code)(Java Doc)
public double getDouble(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc)
public AbstractMemberMetaData getFieldMetaData()(Code)(Java Doc)
public float getFloat(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc)
public int getInt(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc)
abstract public Class getJavaType()(Code)(Java Doc)
public String getJavaTypeForDatastoreMapping(int index)(Code)(Java Doc)
public long getLong(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc)
public int getNumberOfDatastoreFields()(Code)(Java Doc)
public Object getObject(ObjectManager om, Object datastoreResults, int[] exprIndex, StateManager ownerSM, int ownerFieldNumber)(Code)(Java Doc)
public Object getObject(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc)
public JavaTypeMapping getReferenceMapping()(Code)(Java Doc)
public int getRoleForField()(Code)(Java Doc)
abstract public Object getSampleValue(ClassLoaderResolver clr)(Code)(Java Doc)
public short getShort(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc)
public String getString(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc)
public String getType()(Code)(Java Doc)
public boolean includeInFetchStatement()(Code)(Java Doc)
public boolean includeInInsertStatement()(Code)(Java Doc)
public boolean includeInUpdateStatement()(Code)(Java Doc)
public void initialize(DatastoreAdapter dba, String type)(Code)(Java Doc)
public void initialize(DatastoreAdapter dba, AbstractMemberMetaData fmd, DatastoreContainerObject container, ClassLoaderResolver clr)(Code)(Java Doc)
public boolean isNullable()(Code)(Java Doc)
public boolean isSerialised()(Code)(Java Doc)
abstract public ScalarExpression newLiteral(QueryExpression qs, Object value)(Code)(Java Doc)
abstract public ScalarExpression newScalarExpression(QueryExpression qs, LogicSetExpression te)(Code)(Java Doc)
public void setBoolean(ObjectManager om, Object datastoreStatement, int[] exprIndex, boolean value)(Code)(Java Doc)
public void setByte(ObjectManager om, Object datastoreStatement, int[] exprIndex, byte value)(Code)(Java Doc)
public void setChar(ObjectManager om, Object datastoreStatement, int[] exprIndex, char value)(Code)(Java Doc)
public void setDefault(ObjectManager om, Object datastoreStatement, int[] exprIndex)(Code)(Java Doc)
public void setDouble(ObjectManager om, Object datastoreStatement, int[] exprIndex, double value)(Code)(Java Doc)
public void setFieldInformation(AbstractMemberMetaData fmd, DatastoreContainerObject container)(Code)(Java Doc)
public void setFloat(ObjectManager om, Object datastoreStatement, int[] exprIndex, float value)(Code)(Java Doc)
public void setInt(ObjectManager om, Object datastoreStatement, int[] exprIndex, int value)(Code)(Java Doc)
public void setLong(ObjectManager om, Object datastoreStatement, int[] exprIndex, long value)(Code)(Java Doc)
public void setObject(ObjectManager om, Object datastoreStatement, int[] exprIndex, Object value, StateManager ownerSM, int ownerFieldNumber)(Code)(Java Doc)
public void setObject(ObjectManager om, Object datastoreStatement, int[] exprIndex, Object value)(Code)(Java Doc)
public void setReferenceMapping(JavaTypeMapping referenceMapping)(Code)(Java Doc)
public void setRoleForField(int role)(Code)(Java Doc)
public void setShort(ObjectManager om, Object datastoreStatement, int[] exprIndex, short value)(Code)(Java Doc)
public void setString(ObjectManager om, Object datastoreStatement, int[] exprIndex, String value)(Code)(Java Doc)

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.