站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 server API Documentation 英文版文档

JDBCRelationMetaData (JBoss Server API) - JBoss 4.0.1 sp1 server API Documentation 英文版文档


org.jboss.ejb.plugins.cmp.jdbc.metadata
Class JDBCRelationMetaData

java.lang.Object
  extended byorg.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMetaData

public final class JDBCRelationMetaData
extends Object

This class represents one ejb-relation element in the ejb-jar.xml file. Most properties of this class are immutable. The mutable properties have set methods.

Version:
$Revision: 1.25.2.3 $
Author:
Dain Sundstrom , Heiko W. Rupp

Constructor Summary
JDBCRelationMetaData(JDBCApplicationMetaData jdbcApplication, Element element, JDBCRelationMetaData defaultValues)
          Constructs relation meta data with the data contained in the ejb-relation element or the defaults element from a jbosscmp-jdbc xml file.
JDBCRelationMetaData(JDBCApplicationMetaData jdbcApplication, RelationMetaData relationMetaData)
          Constructs jdbc relation meta data with the data from the relation metadata loaded from the ejb-jar.xml file.
 
Method Summary
 boolean getAlterTable()
          Should the relation table be altered on deploy.
 boolean getCreateTable()
          Should the relation table be created on startup.
 DataSource getDataSource()
           
 String getDefaultTableName()
          Gets the name of the relation table.
 JDBCRelationshipRoleMetaData getLeftRelationshipRole()
          Gets the left jdbc relationship role.
 JDBCRelationshipRoleMetaData getOtherRelationshipRole(JDBCRelationshipRoleMetaData role)
          Gets the relationship role related to the specified role.
 int getReadTimeOut()
          Gets the read time out length.
 String getRelationName()
          Gets the relation name.
 boolean getRemoveTable()
          Should the relation table be removed on shutdown.
 JDBCRelationshipRoleMetaData getRightRelationshipRole()
          Gets the right jdbc relationship role.
 JDBCTypeMappingMetaData getTypeMapping()
          Gets the jdbc type mapping for this entity
 boolean hasPrimaryKeyConstraint()
          When the relation table is created, should it have a primary key constraint.
 boolean hasRowLocking()
          Should select queries do row locking
 boolean isForeignKeyMappingStyle()
          Should this relation use foreign keys for storage.
 boolean isReadOnly()
          Is this relation read-only?
 boolean isTableCreated()
          Does the table exist yet? This does not mean that table has been created by the appilcation, or the the database metadata has been checked for the existance of the table, but that at this point the table is assumed to exist.
 boolean isTableDropped()
           
 boolean isTableMappingStyle()
          Should this relation be mapped to a relation table.
 void setTableCreated()
           
 void setTableDropped()
          Sets table dropped flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCRelationMetaData

public JDBCRelationMetaData(JDBCApplicationMetaData jdbcApplication,
                            RelationMetaData relationMetaData)
                     throws org.jboss.deployment.DeploymentException
Constructs jdbc relation meta data with the data from the relation metadata loaded from the ejb-jar.xml file.

Parameters:
jdbcApplication - used to retrieve the entities of this relation
relationMetaData - relation meta data loaded from the ejb-jar.xml file

JDBCRelationMetaData

public JDBCRelationMetaData(JDBCApplicationMetaData jdbcApplication,
                            Element element,
                            JDBCRelationMetaData defaultValues)
                     throws org.jboss.deployment.DeploymentException
Constructs relation meta data with the data contained in the ejb-relation element or the defaults element from a jbosscmp-jdbc xml file. Optional values of the xml element that are not present are loaded from the defaultValues parameter.

Parameters:
jdbcApplication - used to retrieve type mappings in table mapping style
element - the xml Element which contains the metadata about this relation
defaultValues - the JDBCApplicationMetaData which contains the values for optional elements of the element
Throws:
org.jboss.deployment.DeploymentException - if the xml element is not semantically correct
Method Detail

getRelationName

public String getRelationName()
Gets the relation name. Relation name is loaded from the ejb-relation-name element.

Returns:
the name of this relation

getLeftRelationshipRole

public JDBCRelationshipRoleMetaData getLeftRelationshipRole()
Gets the left jdbc relationship role. The relationship role is loaded from an ejb-relationship-role. Left/right assignment is completely arbitrary.

Returns:
the left JDBCRelationshipRoleMetaData

getRightRelationshipRole

public JDBCRelationshipRoleMetaData getRightRelationshipRole()
Gets the right jdbc relationship role. The relationship role is loaded from an ejb-relationship-role. Left/right assignment is completely arbitrary.

Returns:
the right JDBCRelationshipRoleMetaData

getOtherRelationshipRole

public JDBCRelationshipRoleMetaData getOtherRelationshipRole(JDBCRelationshipRoleMetaData role)
Gets the relationship role related to the specified role.

Parameters:
role - the relationship role that the related role is desired
Returns:
the relationship role related to the specified role. right role of this relation

isTableMappingStyle

public boolean isTableMappingStyle()
Should this relation be mapped to a relation table.

Returns:
true if this relation is mapped to a table

isForeignKeyMappingStyle

public boolean isForeignKeyMappingStyle()
Should this relation use foreign keys for storage.

Returns:
true if this relation is mapped to foreign keys

getTypeMapping

public JDBCTypeMappingMetaData getTypeMapping()
                                       throws org.jboss.deployment.DeploymentException
Gets the jdbc type mapping for this entity

Returns:
the jdbc type mapping for this entity
Throws:
org.jboss.deployment.DeploymentException

getDefaultTableName

public String getDefaultTableName()
Gets the name of the relation table.

Returns:
the name of the relation table to which is relation is mapped

isTableCreated

public boolean isTableCreated()
Does the table exist yet? This does not mean that table has been created by the appilcation, or the the database metadata has been checked for the existance of the table, but that at this point the table is assumed to exist.

Returns:
true if the table exists

setTableCreated

public void setTableCreated()

setTableDropped

public void setTableDropped()
Sets table dropped flag.


isTableDropped

public boolean isTableDropped()

getCreateTable

public boolean getCreateTable()
Should the relation table be created on startup.

Returns:
true if the store mananager should attempt to create the relation table

getRemoveTable

public boolean getRemoveTable()
Should the relation table be removed on shutdown.

Returns:
true if the store mananager should attempt to remove the relation table

getAlterTable

public boolean getAlterTable()
Should the relation table be altered on deploy.


hasPrimaryKeyConstraint

public boolean hasPrimaryKeyConstraint()
When the relation table is created, should it have a primary key constraint.

Returns:
true if the store mananager should add a primary key constraint to the the create table sql statement

isReadOnly

public boolean isReadOnly()
Is this relation read-only?


getReadTimeOut

public int getReadTimeOut()
Gets the read time out length.


hasRowLocking

public boolean hasRowLocking()
Should select queries do row locking


getDataSource

public DataSource getDataSource()


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.