JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.datasource.beans
Class NodeProperties

java.lang.Object
  |
  +--com.klg.jclass.datasource.beans.SerializedProperties
        |
        +--com.klg.jclass.datasource.beans.NodeProperties
All Implemented Interfaces:
Serializable

public class NodeProperties
extends SerializedProperties

This class encapsulates information related to data source. For IDE data sources, variable name of the data source is stored.

See Also:
Serialized Form

Field Summary
static int ARRAY
          Array data source type
static int DELETE_ALLOWED_INDEX
          index of DELETE_ALLOWED
static int INSERT_ALLOWED_INDEX
          index of INSERT_ALLOWED
static int JBUILDER
          JBuilder data source type
static int JDBC
          JDBC data source type
static int POWERJ
          PowerJ data source type
protected  String providerName
          If delegation is used, this will be the name of the class providing data
static int UNBOUND
          Unbound data source type
protected  Vector unboundColumns
           
static int UNKNOWN
          Unknown data source type
static int UPDATE_ALLOWED_INDEX
          index of UPDATE_ALLOWED
static int VCAFE
          VisualCafe data source type
 
Fields inherited from class com.klg.jclass.datasource.beans.SerializedProperties
defaultSerializationFileBase, resourceName, serializationFile
 
Constructor Summary
NodeProperties()
          Constructs a NodeProperties.
NodeProperties(int type, String data_source_name)
          Constructs a NodeProperties.
NodeProperties(int type, String data_source_name, String description, String model_name)
          Constructs a NodeProperties.
NodeProperties(String resource_name, Class caller_class)
          Constructs a NodeProperties from a resource relative to a class loader of a caller class.
NodeProperties(String resource_name, ClassLoader cl)
          Constructs a NodeProperties from a resource relative to a class loader.
NodeProperties(String resource_name, ClassLoader cl, Object data_source)
          Constructs a NodeProperties from a resource relative to a class loader.
NodeProperties(String resource_name, Class caller_class, Object data_source)
          Constructs a NodeProperties from a resource relative to a class loader of a caller class.
NodeProperties(String resource_name, Class caller_class, String sfile)
          Constructs a NodeProperties from a resource.
NodeProperties(String resource_name, Class caller_class, String sfile, Object data_source)
          Constructs a NodeProperties from a resource.
 
Method Summary
 void addJoin(String parent_column, String column)
          Adds a join column pair.
 void addUnboundColumn(com.klg.jclass.datasource.ColumnModel c)
           
 void addVirtualColumn(com.klg.jclass.datasource.BaseVirtualColumn vc)
          Adds a virtual column.
 boolean equals(Object o)
          Compares all properties of NodeProperties to check equality.
 boolean getAutoCommit()
          Gets the autoCommit property.
 boolean getCacheChildren()
          Gets the cacheChildren property.
 int getCommitPolicy()
          Gets the commitPolicy property.
 com.klg.jclass.datasource.jdbc.DataTableConnection getConnection()
          Gets DataTableConnection and establishs a JDBC connection.
 String getDatabase()
          Gets the database.
 Object getDataSource()
          Gets the data source.
 String getDataSourceName()
          Gets the data source name.
 int getDataSourceType()
          Gets the data source type.
 String getDescription()
          Gets the description of data bean component.
 String getDriver()
          Gets the driver.
 String getDriverTable()
          Gets the driver table in a select statement.
 Vector getDriverTablePrimaryKeys()
          Gets the primary key columns of the driver table.
 String[][] getJoins()
          Gets all the join columns.
 int getMetaID()
          Returns an int which uniquely identifies this instance of the MetaDataModel.
 String getModelName()
          Sets the model name.
 com.klg.jclass.datasource.beans.NodeProperties getParentNodeProperties()
          Gets the parent data bean component property.
 String getPassword()
          Gets the password for the database.
 boolean getPromptUserForLogin()
          Get boolean if user is prompted for login.
 String getProviderName()
           
static String getSerializedVersion()
          Gets the serialized version of the bean component currently being de-serialized.
 boolean getShowDeletedRows()
          Gets the showDeletedRows property.
 String getStatement()
          Gets the SQL statement.
 Hashtable getTableAccess()
          Gets the data access of all the tables in the data source.
 Vector getUnboundColumns()
           
 String getURL()
          Gets the connection url.
 boolean getUseParentConnection()
          Gets the useParentConnection property.
 String getUser()
          Gets the username parameter.
 String getVCClassName()
          Gets the Visual Cafe QueryNavigator class name.
 String getVCFullName()
          Gets the Visual Cafe data binding full name.
static String getVersion()
          Gets the current version.
 com.klg.jclass.datasource.BaseVirtualColumn getVirtualColumn(String column_name)
          Gets a virtual column by column name.
 Vector getVirtualColumns()
          Gets all virtual columns.
 boolean isExpertMode()
          Indicates if expert mode is used.
static boolean isIDEDataSourceType(int type)
          The data source of the data component is JBuilder, Visual Cafe or PowerJ.
 void removeAllJoins()
          Removes all the join columns.
 void removeAllVirtualColumns()
          Removes all virtual columns.
 void removeJoin(String parent_column, String column)
          Removes a join column pair.
 void removeTableAccess(String alias)
          Removes the data access of the table in the data source.
 void removeUnboundColumn(com.klg.jclass.datasource.ColumnModel c)
           
 void removeVirtualColumn(com.klg.jclass.datasource.BaseVirtualColumn vc)
          Removes a virtual column.
 void resetConnection()
          Resets the connection to null.
 void setAutoCommit(boolean auto_commit)
          Sets the autoCommit property.
 void setCacheChildren(boolean v)
          Sets the cacheChildren property.
 void setChanged()
          Override to set isSerializationRequired to true.
 void setCommitPolicy(int commit_policy)
          Sets the commit policy for this level.
 void setDatabase(String s)
          Sets the database.
 void setDataSource(Object o)
          Sets the data source.
 void setDataSourceName(String s)
          Sets the data source name.
 void setDataSourceType(int type)
          Sets data source type.
 void setDescription(String description)
          Sets the description of data bean component.
 void setDriver(String s)
          Sets the driver.
 void setDriverTable(String s)
          Sets the driver table in a select statement.
 void setDriverTablePrimaryKeys(Vector v)
          Sets the primary key columns of the driver table.
 void setExpertMode(boolean v)
          Sets to use expert mode or not.
 void setJDBCInfo(String driver, String url, String user, String password, String database)
          Sets the JDBC information.
 void setMetaID(int id)
          Assigns a unique id to a meta data instance.
 void setModelName(String s)
          Sets the model name.
 void setParentNodeProperties(com.klg.jclass.datasource.beans.NodeProperties parent)
          Sets the parent data bean component property.
 void setPassword(String s)
          Sets the password for the database.
 void setPromptUserForLogin(boolean v)
          Set if user is prompted for login.
 void setProviderName(String providerName)
           
 void setShowDeletedRows(boolean v)
          Sets the showDeletedRows property.
 void setStatement(String s)
          Sets the SQL statement.
 void setTableAccess(String alias, Boolean[] access)
          Sets the data access type for all the tables in the data source.
 void setURL(String s)
          Sets the connection url.
 void setUseParentConnection(boolean v)
          Sets a boolean indicating if this data source uses the parent JDBC connection.
 void setUser(String s)
          Sets the username parameter.
 void setVCClassName(String s)
          Sets the Visual Cafe QueryNavigator class name.
 void setVCFullName(String s)
          Sets the Visual Cafe data binding full name.
 String toString()
           
 
Methods inherited from class com.klg.jclass.datasource.beans.SerializedProperties
addJCDataListener, fireJCDataEvent, fromFile, fromResource, fromResource, getDefaultSerializationFile, getDefaultSerializationFileToOpen, getResourceName, getSerializationFile, isResourceNameSpecified, isSameString, isSerializationRequired, removeJCDataListener, setDefaultSerializationFileBase, setResourceName, setSerializationFile, toFile
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

JBUILDER

public static final int JBUILDER
JBuilder data source type

See Also:
Constant Field Values

JDBC

public static final int JDBC
JDBC data source type

See Also:
Constant Field Values

POWERJ

public static final int POWERJ
PowerJ data source type

See Also:
Constant Field Values

VCAFE

public static final int VCAFE
VisualCafe data source type

See Also:
Constant Field Values

ARRAY

public static final int ARRAY
Array data source type

See Also:
Constant Field Values

UNBOUND

public static final int UNBOUND
Unbound data source type

See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
Unknown data source type

See Also:
Constant Field Values

INSERT_ALLOWED_INDEX

public static final int INSERT_ALLOWED_INDEX
index of INSERT_ALLOWED

See Also:
Constant Field Values

UPDATE_ALLOWED_INDEX

public static final int UPDATE_ALLOWED_INDEX
index of UPDATE_ALLOWED

See Also:
Constant Field Values

DELETE_ALLOWED_INDEX

public static final int DELETE_ALLOWED_INDEX
index of DELETE_ALLOWED

See Also:
Constant Field Values

providerName

protected String providerName
If delegation is used, this will be the name of the class providing data


unboundColumns

protected Vector unboundColumns
Constructor Detail

NodeProperties

public NodeProperties()
Constructs a NodeProperties.


NodeProperties

public NodeProperties(int type,
                      String data_source_name)
Constructs a NodeProperties.

Parameters:
type - data source type
data_source_name - variable name of data source for the type

NodeProperties

public NodeProperties(int type,
                      String data_source_name,
                      String description,
                      String model_name)
Constructs a NodeProperties.

Parameters:
type - data source type
data_source_name - variable name of data source for the type
description - description of the data bean component.

NodeProperties

public NodeProperties(String resource_name,
                      ClassLoader cl)
               throws DataModelException
Constructs a NodeProperties from a resource relative to a class loader.

Throws:
DataModelException - If the component can't be instantiated.

NodeProperties

public NodeProperties(String resource_name,
                      ClassLoader cl,
                      Object data_source)
               throws DataModelException
Constructs a NodeProperties from a resource relative to a class loader.

Throws:
DataModelException - If the component can't be instantiated.

NodeProperties

public NodeProperties(String resource_name,
                      Class caller_class,
                      String sfile)
               throws DataModelException
Constructs a NodeProperties from a resource. First, the package name of the caller class is prepended to the resource name to locate the resource. If no resource is found, the passed-in resource name is used.

Parameters:
resource_name - resource name relative to a class loader to the bean component. It must have the right extension.
caller_class - class that uses the serialized bean component.
sfile - serialization file that is used at design-time in JBuilder to load a NodeProperties.
Throws:
DataModelException - If the class can't be loaded.
See Also:
ClassLoader

NodeProperties

public NodeProperties(String resource_name,
                      Class caller_class,
                      String sfile,
                      Object data_source)
               throws DataModelException
Constructs a NodeProperties from a resource. First, the package name of the caller class is prepended to the resource name to locate the resource. If no resource is found, the passed-in resource name is used.

Parameters:
resource_name - resource name relative to a class loader to the bean component. It must have the right extension.
caller_class - class that uses the serialized bean component.
sfile - serialization file that is used at design-time in JBuilder to load a NodeProperties.
Throws:
DataModelException - If the class can't be loaded.
See Also:
ClassLoader

NodeProperties

public NodeProperties(String resource_name,
                      Class caller_class)
               throws DataModelException
Constructs a NodeProperties from a resource relative to a class loader of a caller class.

Throws:
DataModelException - If the component can't be instantiated.

NodeProperties

public NodeProperties(String resource_name,
                      Class caller_class,
                      Object data_source)
               throws DataModelException
Constructs a NodeProperties from a resource relative to a class loader of a caller class.

Throws:
DataModelException - If the component can't be instantiated.
Method Detail

setModelName

public void setModelName(String s)
Sets the model name.


getModelName

public String getModelName()
Sets the model name.


getMetaID

public int getMetaID()
Returns an int which uniquely identifies this instance of the MetaDataModel.

Returns:
an int which uniquely identifies a meta data model.
See Also:
setMetaID(int)

setMetaID

public void setMetaID(int id)
Assigns a unique id to a meta data instance. Default is -1. Unless this meta id is set, meta data created will use its auto-generated number. an auto-generated number is used. For internal use only.

Parameters:
id - an int which is the unique id for this instance
See Also:
getMetaID()

getDescription

public String getDescription()
Gets the description of data bean component.


setDescription

public void setDescription(String description)
Sets the description of data bean component.


setDataSourceType

public void setDataSourceType(int type)
Sets data source type. It must be one of the following:


getDataSourceType

public int getDataSourceType()
Gets the data source type.


setVCClassName

public void setVCClassName(String s)
Sets the Visual Cafe QueryNavigator class name. It is used at design-time for JClass data-binding.


getVCClassName

public String getVCClassName()
Gets the Visual Cafe QueryNavigator class name. It is used at design-time for JClass data-binding.


setVCFullName

public void setVCFullName(String s)
Sets the Visual Cafe data binding full name. It is used at design-time for JClass data-binding.


getVCFullName

public String getVCFullName()
Gets the Visual Cafe data binding full name. It is used at design-time for JClass data-binding.


setDataSourceName

public void setDataSourceName(String s)
Sets the data source name.


getDataSourceName

public String getDataSourceName()
Gets the data source name.


setDataSource

public void setDataSource(Object o)
Sets the data source.


getDataSource

public Object getDataSource()
Gets the data source.


getCommitPolicy

public int getCommitPolicy()
Gets the commitPolicy property.

See Also:
BaseMetaData.setCommitPolicy(int)

setCommitPolicy

public void setCommitPolicy(int commit_policy)
Sets the commit policy for this level. Determines when changes are permanently written to the originating data source. Must be one of COMMIT_LEAVING_RECORD, COMMIT_LEAVING_PARENT, or COMMIT_MANUALLY.

Parameters:
commit_policy - an int, one of MetaDataModel.COMMIT_LEAVING_RECORD, MetaDataModel.COMMIT_LEAVING_PARENT, or MetaDataModel.COMMIT_MANUALLY

getAutoCommit

public boolean getAutoCommit()
Gets the autoCommit property.

See Also:
setAutoCommit(boolean)

setAutoCommit

public void setAutoCommit(boolean auto_commit)
Sets the autoCommit property.

See Also:
MetaDataModel.setAutoCommit(boolean)

getShowDeletedRows

public boolean getShowDeletedRows()
Gets the showDeletedRows property.

See Also:
setShowDeletedRows(boolean)

setShowDeletedRows

public void setShowDeletedRows(boolean v)
Sets the showDeletedRows property.

See Also:
MetaDataModel.setShowDeletedRows(boolean)

getCacheChildren

public boolean getCacheChildren()
Gets the cacheChildren property.

See Also:
setCacheChildren(boolean)

setCacheChildren

public void setCacheChildren(boolean v)
Sets the cacheChildren property.

See Also:
MetaDataModel.setCacheChildren(boolean)

isIDEDataSourceType

public static boolean isIDEDataSourceType(int type)
The data source of the data component is JBuilder, Visual Cafe or PowerJ.


setTableAccess

public void setTableAccess(String alias,
                           Boolean[] access)
Sets the data access type for all the tables in the data source.

Parameters:
alias - alias or qualified name of a table

getTableAccess

public Hashtable getTableAccess()
Gets the data access of all the tables in the data source.


removeTableAccess

public void removeTableAccess(String alias)
Removes the data access of the table in the data source.

Parameters:
alias - alias or qualified name of a table

addVirtualColumn

public void addVirtualColumn(com.klg.jclass.datasource.BaseVirtualColumn vc)
Adds a virtual column.

Parameters:
vc - virtual column to be added.
See Also:
BaseVirtualColumn

removeVirtualColumn

public void removeVirtualColumn(com.klg.jclass.datasource.BaseVirtualColumn vc)
Removes a virtual column.

Parameters:
vc - virtual column to be removed.
See Also:
BaseVirtualColumn

removeAllVirtualColumns

public void removeAllVirtualColumns()
Removes all virtual columns.

See Also:
BaseVirtualColumn

getVirtualColumns

public Vector getVirtualColumns()
Gets all virtual columns.


getVirtualColumn

public com.klg.jclass.datasource.BaseVirtualColumn getVirtualColumn(String column_name)
Gets a virtual column by column name.


setProviderName

public void setProviderName(String providerName)

getProviderName

public String getProviderName()

getUnboundColumns

public Vector getUnboundColumns()

addUnboundColumn

public void addUnboundColumn(com.klg.jclass.datasource.ColumnModel c)

removeUnboundColumn

public void removeUnboundColumn(com.klg.jclass.datasource.ColumnModel c)

setPromptUserForLogin

public void setPromptUserForLogin(boolean v)
Set if user is prompted for login.


getPromptUserForLogin

public boolean getPromptUserForLogin()
Get boolean if user is prompted for login.


setJDBCInfo

public void setJDBCInfo(String driver,
                        String url,
                        String user,
                        String password,
                        String database)
                 throws Exception
Sets the JDBC information.

Throws:
Exception - If setJDBCInfo fails.

setDriver

public void setDriver(String s)
               throws Exception
Sets the driver.

Throws:
Exception - If setDriver fails.

getDriver

public String getDriver()
Gets the driver.


setURL

public void setURL(String s)
            throws Exception
Sets the connection url.

Throws:
Exception - If setURL fails.

getURL

public String getURL()
Gets the connection url.


setUser

public void setUser(String s)
             throws Exception
Sets the username parameter.

Throws:
Exception - If setUser fails.

getUser

public String getUser()
Gets the username parameter.


setPassword

public void setPassword(String s)
                 throws Exception
Sets the password for the database.

Throws:
Exception - If setPassword fails.

getPassword

public String getPassword()
Gets the password for the database.


setDatabase

public void setDatabase(String s)
                 throws Exception
Sets the database.

Throws:
Exception - If setDatabase fails.

getDatabase

public String getDatabase()
Gets the database.


setStatement

public void setStatement(String s)
                  throws Exception
Sets the SQL statement.

Throws:
Exception - If setStatement fails.

getStatement

public String getStatement()
Gets the SQL statement.


isExpertMode

public boolean isExpertMode()
Indicates if expert mode is used. No parsing is done in expert mode.


setExpertMode

public void setExpertMode(boolean v)
Sets to use expert mode or not. No parsing is done in expert mode.


setDriverTable

public void setDriverTable(String s)
                    throws Exception
Sets the driver table in a select statement.

Throws:
Exception - If setDriverTable fails.

getDriverTable

public String getDriverTable()
Gets the driver table in a select statement.


setDriverTablePrimaryKeys

public void setDriverTablePrimaryKeys(Vector v)
                               throws Exception
Sets the primary key columns of the driver table.

Throws:
Exception - If setDriverTablePrimaryKeys fails.

getDriverTablePrimaryKeys

public Vector getDriverTablePrimaryKeys()
Gets the primary key columns of the driver table.


getUseParentConnection

public boolean getUseParentConnection()
Gets the useParentConnection property.

See Also:
setUseParentConnection(boolean)

setUseParentConnection

public void setUseParentConnection(boolean v)
Sets a boolean indicating if this data source uses the parent JDBC connection. The default is to use the parent connection.

Parameters:
v - a boolean indicating if parent connection is used.

getConnection

public com.klg.jclass.datasource.jdbc.DataTableConnection getConnection()
                                                                 throws DataModelException
Gets DataTableConnection and establishs a JDBC connection.

Throws:
DataModelException - If the connection fails.

resetConnection

public void resetConnection()
Resets the connection to null.


getParentNodeProperties

public com.klg.jclass.datasource.beans.NodeProperties getParentNodeProperties()
Gets the parent data bean component property.

See Also:
setParentNodeProperties(com.klg.jclass.datasource.beans.NodeProperties)

setParentNodeProperties

public void setParentNodeProperties(com.klg.jclass.datasource.beans.NodeProperties parent)
Sets the parent data bean component property.

Parameters:
parent - parent of this data bean component.

addJoin

public void addJoin(String parent_column,
                    String column)
Adds a join column pair.

Parameters:
parent_column - column name of parent data source
column - column name of current data source

removeJoin

public void removeJoin(String parent_column,
                       String column)
Removes a join column pair.

Parameters:
parent_column - column name of parent data source
column - column name of current data source

removeAllJoins

public void removeAllJoins()
Removes all the join columns.


getJoins

public String[][] getJoins()
Gets all the join columns.

Returns:
an array of two columns. First column is column name of parent data source and second column is column name of data source

getVersion

public static String getVersion()
Gets the current version.


getSerializedVersion

public static String getSerializedVersion()
Gets the serialized version of the bean component currently being de-serialized.


equals

public boolean equals(Object o)
Compares all properties of NodeProperties to check equality. It is done in this way because of serialization. After serialization, a NodeProperties is stored in different memory space than the NodeProperties before serialization.

Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

setChanged

public void setChanged()
Description copied from class: SerializedProperties
Override to set isSerializationRequired to true.

Overrides:
setChanged in class SerializedProperties

Copyright © 2004 Quest Software Inc..
All rights reserved.