Java Doc for JDBCCMRFieldBridge.java in  » EJB-Server-JBoss-4.2.1 » server » org » jboss » ejb » plugins » cmp » jdbc » bridge » 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 » EJB Server JBoss 4.2.1 » server » org.jboss.ejb.plugins.cmp.jdbc.bridge 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMRFieldBridge
      org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge

JDBCCMRFieldBridge
final public class JDBCCMRFieldBridge extends JDBCAbstractCMRFieldBridge (Code)
JDBCCMRFieldBridge a bean relationship. This class only supports relationships between entities managed by a JDBCStoreManager in the same application.

Life-cycle: Tied to the EntityBridge.

Multiplicity: One for each role that entity has.
author:
   Dain Sundstrom
author:
   Alex Loubyansky
version:
   $Revision: 61754 $


Inner Class :public static interface RelationDataManager
Inner Class :public static class M2MRelationManager implements RelationDataManager
Inner Class :interface SecurityActions


Constructor Summary
public  JDBCCMRFieldBridge(JDBCEntityBridge entity, JDBCStoreManager manager, JDBCRelationshipRoleMetaData metadata)
     Creates a cmr field for the entity based on the metadata.

Method Summary
public  voidaddRelatedPKWaitingForMyPK(Object myPK, Object relatedPK)
    
public  voidaddRelatedPKsWaitedForMe(EntityEnterpriseContext ctx)
     Establishes relationships with related entities waited for passed in context to be created.
public  voidaddRelation(EntityEnterpriseContext myCtx, Object fk)
     Adds the foreign key to the set of related ids, and updates any foreign key fields.
public  booleanallFkFieldsMappedToPkFields()
    
public  voidcascadeDelete(EntityEnterpriseContext ctx, List oldValues)
    
public  voidcreateRelationLinks(EntityEnterpriseContext myCtx, Object relatedId)
     Creates the relation links between the instance associated with the context and the related instance (just the id is passed in).
public  voidcreateRelationLinks(EntityEnterpriseContext myCtx, Object relatedId, boolean updateForeignKey)
    
public  voiddestroyRelationLinks(EntityEnterpriseContext myCtx, Object relatedId)
     Destroys the relation links between the instance associated with the context and the related instance (just the id is passed in).
public  voiddestroyRelationLinks(EntityEnterpriseContext myCtx, Object relatedId, boolean updateValueCollection)
     Destroys the relation links between the instance associated with the context and the related instance (just the id is passed in).

This method calls a.removeRelation(b) and b.removeRelation(a)

If updateValueCollection is false, the related id collection is not updated.

public  voiddestroyRelationLinks(EntityEnterpriseContext myCtx, Object relatedId, boolean updateValueCollection, boolean updateForeignKey)
    
public  DataSourcegetDataSource()
     Gets the datasource of the relation table if relevent.
public  JDBCAbstractEntityBridgegetEntity()
     Gets bridge for this entity.
public  StringgetFieldName()
     Gets the name of this field.
public  JDBCFieldBridge[]getForeignKeyFields()
    
public  ObjectgetInstanceValue(EntityEnterpriseContext myCtx)
     Gets the value of the cmr field for the instance associated with the context.
public  JDBCStoreManagergetJDBCStoreManager()
     Gets the manager of this entity.
public  JDBCTypegetJDBCType()
    
public  JDBCEntityPersistenceStoregetManager()
    
public  JDBCRelationshipRoleMetaDatagetMetaData()
     Gets the metadata of the relationship role that this field represents.
public  StringgetQualifiedTableName()
     Gets the name of the relation table if relevent.
public  JDBCReadAheadMetaDatagetReadAhead()
     Gets the read ahead meta data.
public  JDBCAbstractCMRFieldBridgegetRelatedCMRField()
     The related entity's cmr field for this relationship.
public  EntityBridgegetRelatedEntity()
     The related entity.
public  EJBLocalObjectgetRelatedEntityByFK(Object fk)
     Returns related entity's local interface. If there are foreign key fields mapped to CMP fields, existence of related entity is checked with findByPrimaryKey and if, in this case, related instance is not found, null is returned. If foreign key fields mapped to its own columns then existence of related entity is not checked and just its local object is returned.
Parameters:
  fk - - foreign key value.
public  ObjectgetRelatedId(EntityEnterpriseContext myCtx)
     Get the related entity's id.
public  ObjectgetRelatedIdFromContext(EntityEnterpriseContext ctx)
     Creates a new instance of related id based on foreign key value in the context.
Parameters:
  ctx - - entity's context.
final public  LocalProxyFactorygetRelatedInvoker()
     The related entity's local container invoker.
public  JDBCEntityBridgegetRelatedJDBCEntity()
     The related entity.
final public  ClassgetRelatedLocalInterface()
     The related entity's local home interface.
public  JDBCStoreManagergetRelatedManager()
     The related manger.
public  RelationDataManagergetRelationDataManager()
    
public  JDBCRelationMetaDatagetRelationMetaData()
     Gets the relation metadata.
public  JDBCFieldBridge[]getTableKeyFields()
     Gets the key fields that this entity maintains in the relation table.
public  StringgetTableName()
    
public  ObjectgetValue(EntityEnterpriseContext ctx)
    
Parameters:
  ctx - - entity's context.
public  booleanhasFKFieldsMappedToCMPFields()
    
public  booleanhasForeignKey()
     Does this cmr field have foreign keys.
public  voidinitInstance(EntityEnterpriseContext ctx)
     Initialized the foreign key fields.
public  booleaninvalidateCache(EntityEnterpriseContext ctx)
    
public  booleanisBatchCascadeDelete()
    
public  booleanisCMPField()
    
public  booleanisCollectionValued()
     Is this a collection valued field.
public  booleanisDirty(EntityEnterpriseContext ctx)
     This method is never called.
public  booleanisForeignKeyValid(Object fk)
     This method is called only for CMR fields with foreign key fields mapped to CMP fields to check the validity of the foreign key value.
public  booleanisLoaded(EntityEnterpriseContext ctx)
    
public  booleanisPrimaryKeyMember()
    
public  booleanisReadOnly()
    
public  booleanisReadTimedOut(EntityEnterpriseContext ctx)
    
public  booleanisSingleValued()
     Is this a single valued field.
public  voidload(EntityEnterpriseContext myCtx, Collection values)
    
public  intloadArgumentResults(ResultSet rs, int parameterIndex, Object[] fkRef)
    
public  intloadInstanceResults(ResultSet rs, int parameterIndex, EntityEnterpriseContext ctx)
    
public  booleanremoveFromRelations(EntityEnterpriseContext ctx, Object[] oldRelationsRef)
    
public  voidremoveRelatedPKWaitingForMyPK(Object myPK, Object relatedPK)
    
public  voidremoveRelation(EntityEnterpriseContext myCtx, Object fk)
     Removes the foreign key to the set of related ids, and updates any foreign key fields.
public  voidresetPersistenceContext(EntityEnterpriseContext ctx)
    
public  voidresolveRelationship()
    
public  voidscheduleChildrenForBatchCascadeDelete(EntityEnterpriseContext ctx)
     Schedules children for batch cascade delete.
public  voidscheduleChildrenForCascadeDelete(EntityEnterpriseContext ctx)
     Schedules children for cascade delete.
public  voidsetClean(EntityEnterpriseContext ctx)
     This method is never called.
public  voidsetForeignKey(EntityEnterpriseContext myCtx, Object fk)
     Sets the foreign key field value.
public  intsetInstanceParameters(PreparedStatement ps, int parameterIndex, EntityEnterpriseContext ctx)
    
public  voidsetInstanceValue(EntityEnterpriseContext myCtx, Object newValue)
     Sets the value of the cmr field for the instance associated with the context.
public  voidsetValue(EntityEnterpriseContext ctx, Object value)
     Sets new value.
public  voidstart()
     The third phase of deployment.
public  StringtoString()
    


Constructor Detail
JDBCCMRFieldBridge
public JDBCCMRFieldBridge(JDBCEntityBridge entity, JDBCStoreManager manager, JDBCRelationshipRoleMetaData metadata) throws DeploymentException(Code)
Creates a cmr field for the entity based on the metadata.




Method Detail
addRelatedPKWaitingForMyPK
public void addRelatedPKWaitingForMyPK(Object myPK, Object relatedPK)(Code)



addRelatedPKsWaitedForMe
public void addRelatedPKsWaitedForMe(EntityEnterpriseContext ctx)(Code)
Establishes relationships with related entities waited for passed in context to be created.
Parameters:
  ctx - - entity's context.



addRelation
public void addRelation(EntityEnterpriseContext myCtx, Object fk)(Code)
Adds the foreign key to the set of related ids, and updates any foreign key fields.



allFkFieldsMappedToPkFields
public boolean allFkFieldsMappedToPkFields()(Code)
Returns true if all FK fields are mapped to PK fields



cascadeDelete
public void cascadeDelete(EntityEnterpriseContext ctx, List oldValues) throws RemoveException, RemoteException(Code)



createRelationLinks
public void createRelationLinks(EntityEnterpriseContext myCtx, Object relatedId)(Code)
Creates the relation links between the instance associated with the context and the related instance (just the id is passed in).

This method calls a.addRelation(b) and b.addRelation(a)




createRelationLinks
public void createRelationLinks(EntityEnterpriseContext myCtx, Object relatedId, boolean updateForeignKey)(Code)



destroyRelationLinks
public void destroyRelationLinks(EntityEnterpriseContext myCtx, Object relatedId)(Code)
Destroys the relation links between the instance associated with the context and the related instance (just the id is passed in).

This method calls a.removeRelation(b) and b.removeRelation(a)




destroyRelationLinks
public void destroyRelationLinks(EntityEnterpriseContext myCtx, Object relatedId, boolean updateValueCollection)(Code)
Destroys the relation links between the instance associated with the context and the related instance (just the id is passed in).

This method calls a.removeRelation(b) and b.removeRelation(a)

If updateValueCollection is false, the related id collection is not updated. This form is only used by the RelationSet iterator.




destroyRelationLinks
public void destroyRelationLinks(EntityEnterpriseContext myCtx, Object relatedId, boolean updateValueCollection, boolean updateForeignKey)(Code)



getDataSource
public DataSource getDataSource()(Code)
Gets the datasource of the relation table if relevent.



getEntity
public JDBCAbstractEntityBridge getEntity()(Code)
Gets bridge for this entity.



getFieldName
public String getFieldName()(Code)
Gets the name of this field.



getForeignKeyFields
public JDBCFieldBridge[] getForeignKeyFields()(Code)
Gets the foreign key fields of this entity (i.e., related entities pk fields)



getInstanceValue
public Object getInstanceValue(EntityEnterpriseContext myCtx)(Code)
Gets the value of the cmr field for the instance associated with the context.



getJDBCStoreManager
public JDBCStoreManager getJDBCStoreManager()(Code)
Gets the manager of this entity.



getJDBCType
public JDBCType getJDBCType()(Code)



getManager
public JDBCEntityPersistenceStore getManager()(Code)



getMetaData
public JDBCRelationshipRoleMetaData getMetaData()(Code)
Gets the metadata of the relationship role that this field represents.



getQualifiedTableName
public String getQualifiedTableName()(Code)
Gets the name of the relation table if relevent.



getReadAhead
public JDBCReadAheadMetaData getReadAhead()(Code)
Gets the read ahead meta data.



getRelatedCMRField
public JDBCAbstractCMRFieldBridge getRelatedCMRField()(Code)
The related entity's cmr field for this relationship.



getRelatedEntity
public EntityBridge getRelatedEntity()(Code)
The related entity.



getRelatedEntityByFK
public EJBLocalObject getRelatedEntityByFK(Object fk)(Code)
Returns related entity's local interface. If there are foreign key fields mapped to CMP fields, existence of related entity is checked with findByPrimaryKey and if, in this case, related instance is not found, null is returned. If foreign key fields mapped to its own columns then existence of related entity is not checked and just its local object is returned.
Parameters:
  fk - - foreign key value. related local object instance.



getRelatedId
public Object getRelatedId(EntityEnterpriseContext myCtx)(Code)
Get the related entity's id. This only works on single valued cmr fields.



getRelatedIdFromContext
public Object getRelatedIdFromContext(EntityEnterpriseContext ctx)(Code)
Creates a new instance of related id based on foreign key value in the context.
Parameters:
  ctx - - entity's context. related entity's id.



getRelatedInvoker
final public LocalProxyFactory getRelatedInvoker()(Code)
The related entity's local container invoker.



getRelatedJDBCEntity
public JDBCEntityBridge getRelatedJDBCEntity()(Code)
The related entity.



getRelatedLocalInterface
final public Class getRelatedLocalInterface()(Code)
The related entity's local home interface.



getRelatedManager
public JDBCStoreManager getRelatedManager()(Code)
The related manger.



getRelationDataManager
public RelationDataManager getRelationDataManager()(Code)



getRelationMetaData
public JDBCRelationMetaData getRelationMetaData()(Code)
Gets the relation metadata.



getTableKeyFields
public JDBCFieldBridge[] getTableKeyFields()(Code)
Gets the key fields that this entity maintains in the relation table.



getTableName
public String getTableName()(Code)



getValue
public Object getValue(EntityEnterpriseContext ctx)(Code)

Parameters:
  ctx - - entity's context. the value of this field.



hasFKFieldsMappedToCMPFields
public boolean hasFKFieldsMappedToCMPFields()(Code)



hasForeignKey
public boolean hasForeignKey()(Code)
Does this cmr field have foreign keys.



initInstance
public void initInstance(EntityEnterpriseContext ctx)(Code)
Initialized the foreign key fields.



invalidateCache
public boolean invalidateCache(EntityEnterpriseContext ctx)(Code)



isBatchCascadeDelete
public boolean isBatchCascadeDelete()(Code)



isCMPField
public boolean isCMPField()(Code)



isCollectionValued
public boolean isCollectionValued()(Code)
Is this a collection valued field.



isDirty
public boolean isDirty(EntityEnterpriseContext ctx)(Code)
This method is never called. In case of a CMR with foreign key fields, only the foreign key fields are asked for the dirty state.



isForeignKeyValid
public boolean isForeignKeyValid(Object fk)(Code)
This method is called only for CMR fields with foreign key fields mapped to CMP fields to check the validity of the foreign key value.
Parameters:
  fk - the foreign key to check true if there is related entity with the equal primary key



isLoaded
public boolean isLoaded(EntityEnterpriseContext ctx)(Code)

Parameters:
  ctx - - entity's context true if entity is loaded, false - otherwise.



isPrimaryKeyMember
public boolean isPrimaryKeyMember()(Code)



isReadOnly
public boolean isReadOnly()(Code)
Is this field readonly?



isReadTimedOut
public boolean isReadTimedOut(EntityEnterpriseContext ctx)(Code)
Had the read time expired?



isSingleValued
public boolean isSingleValued()(Code)
Is this a single valued field.



load
public void load(EntityEnterpriseContext myCtx, Collection values)(Code)



loadArgumentResults
public int loadArgumentResults(ResultSet rs, int parameterIndex, Object[] fkRef)(Code)



loadInstanceResults
public int loadInstanceResults(ResultSet rs, int parameterIndex, EntityEnterpriseContext ctx)(Code)



removeFromRelations
public boolean removeFromRelations(EntityEnterpriseContext ctx, Object[] oldRelationsRef)(Code)



removeRelatedPKWaitingForMyPK
public void removeRelatedPKWaitingForMyPK(Object myPK, Object relatedPK)(Code)



removeRelation
public void removeRelation(EntityEnterpriseContext myCtx, Object fk)(Code)
Removes the foreign key to the set of related ids, and updates any foreign key fields.



resetPersistenceContext
public void resetPersistenceContext(EntityEnterpriseContext ctx)(Code)
resets the persistence context of the foreign key fields



resolveRelationship
public void resolveRelationship() throws DeploymentException(Code)



scheduleChildrenForBatchCascadeDelete
public void scheduleChildrenForBatchCascadeDelete(EntityEnterpriseContext ctx)(Code)
Schedules children for batch cascade delete.



scheduleChildrenForCascadeDelete
public void scheduleChildrenForCascadeDelete(EntityEnterpriseContext ctx)(Code)
Schedules children for cascade delete.



setClean
public void setClean(EntityEnterpriseContext ctx)(Code)
This method is never called. In case of a CMR - with foreign key fields, the foreign key fields are cleaned when necessary according to CMP fields' behaviour. - from m:m relationship, added/removed key pairs are cleared in application tx data map on sync.



setForeignKey
public void setForeignKey(EntityEnterpriseContext myCtx, Object fk)(Code)
Sets the foreign key field value.



setInstanceParameters
public int setInstanceParameters(PreparedStatement ps, int parameterIndex, EntityEnterpriseContext ctx)(Code)



setInstanceValue
public void setInstanceValue(EntityEnterpriseContext myCtx, Object newValue)(Code)
Sets the value of the cmr field for the instance associated with the context.



setValue
public void setValue(EntityEnterpriseContext ctx, Object value)(Code)
Sets new value.
Parameters:
  ctx - - entity's context;
Parameters:
  value - - new value.



start
public void start() throws DeploymentException(Code)
The third phase of deployment. The method is called when relationships are already resolved.
throws:
  DeploymentException -



toString
public String toString()(Code)



Methods inherited from org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMRFieldBridge
abstract public JDBCAbstractEntityBridge getEntity()(Code)(Java Doc)
abstract public JDBCFieldBridge[] getForeignKeyFields()(Code)(Java Doc)
abstract public JDBCRelationshipRoleMetaData getMetaData()(Code)(Java Doc)
public Object getPrimaryKeyValue(Object o)(Code)(Java Doc)
abstract public String getQualifiedTableName()(Code)(Java Doc)
abstract public JDBCAbstractCMRFieldBridge getRelatedCMRField()(Code)(Java Doc)
abstract public JDBCFieldBridge[] getTableKeyFields()(Code)(Java Doc)
abstract public String getTableName()(Code)(Java Doc)
abstract public boolean hasForeignKey()(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)

w_w___w___.__j_a_va_2s.__c__o_m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.