|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.altair.hwm.database.dbmodel.HWMClass
public class HWMClass
Title: HWMClass
Description: This class represents the class objects created in the data model
Company: Altair Engineering, Inc.
Field Summary | |
---|---|
static java.lang.String |
HWM_UNIQUE_ID
The mandatory attrib's name which is the uniquely generated ID |
static int |
MANDATORY_ATTRIB_COUNT
The number of mandatory attributes in a class |
static java.lang.String |
PROP_CLASS_ATTRIB
The name of the property (attrib to display) which when changed, an event is fired |
static java.lang.String |
PROP_CLASS_ATTRIB_ADD
The name of the property (attribute added) which when added, an event is fired |
static java.lang.String |
PROP_CLASS_ATTRIB_DEL
The name of the property (attribute removed) which when removed, an event is fired |
static java.lang.String |
PROP_CLASS_CONST
The name of the property (constraints) which when changed, an event is fired |
static java.lang.String |
PROP_CLASS_DISPLAY
The name of the property (display name) which when changed, an event is fired |
static java.lang.String |
PROP_CLASS_NAME
The name of the property (class name) which when changed, an event is fired |
Method Summary | |
---|---|
HWMAttribute |
AddAttribute(java.lang.String strAttribName)
Add a attribute to the class |
long |
AddData(java.util.Hashtable hashNameToValue)
Adds a record to the table |
HWMForeignAttribute |
AddForeignAttribute(java.lang.String strName,
HWMAttribute hwmAttrib)
Add a foreign attribute to the class |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener propChangeListener)
Add property change listener |
void |
addVetoableChangeListener(java.beans.VetoableChangeListener vetoableListener)
Add vetoable change listener |
void |
Export(org.jdom.Element elemClass)
Creates XML element representation of this class |
HWMAttribute |
GetAttribute(java.lang.String strAttribName)
Gets the attribute with the given name |
int |
GetAttributeCount()
Gets the number of attributes |
java.util.Vector |
GetAttributes()
Gets all the attributes in the class. |
HWMClassConstraints |
GetConstraints()
Gets the constraints for this class. |
java.sql.ResultSet |
GetData()
Gets all the instances/records in this class/table |
java.sql.ResultSet |
GetData(java.util.Hashtable hashNameToValue)
Gets all the instances/records in this class/table given the values for the certain attribs |
java.sql.ResultSet |
GetData(java.lang.String strAttribName,
java.lang.Object objValue)
Gets all the instances/records in this class/table where the value for the given attrib - strAttribName is strValue |
HWMDBModel |
GetDataModel()
Returns the data model to which this class belongs to |
java.lang.String |
GetDisplayName()
Gets the display name of the class |
java.util.Vector |
GetForeignAttributes()
Gets all the foreign attributes |
java.lang.String |
GetName()
Gets the name of the class |
java.lang.String |
GetPrimaryAttribute()
Gets the primary attribute's name in the class. |
java.util.Vector |
GetRelatedClasses()
Gets all the related classes |
java.lang.String |
GetSQLRepresentation(HWMDatabaseInfo hwmDBInfo)
Returns a string which represents this class in the database. |
void |
Import(org.jdom.Element elemClass)
Recreates the class |
void |
Init()
Init creates the required attributes |
boolean |
IsEditable()
returns a flag indicating if this class can be edited |
boolean |
IsRelated(HWMClass hwmClass)
Returns true if there is an attribute from the given class present in this class |
boolean |
IsVisible()
returns a flag indicating if this class should be visible in the view of the datamodel i.e. |
void |
propertyChange(java.beans.PropertyChangeEvent propChangeEvt)
This event is fired whenever a class is deleted. |
void |
RemoveAttribute(java.lang.String strAttribName)
Removes a attribute from the class |
void |
RemoveData(java.util.Hashtable hashNameToValue)
Removes records from the table |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener propChangeListener)
Remove property change listener |
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener vetoableListener)
Remove vetoable change listener |
void |
Resolve()
Resolves the foreign attribs and constraints. |
void |
SetDisplayName(java.lang.String strDisplayName)
Sets the display name of the class |
void |
SetEditable(boolean bEditable)
Sets the flag indicating if this class can be edited |
void |
SetName(java.lang.String strName)
Sets the name of the class |
void |
SetVisible(boolean bVisible)
Sets the flag indicating if this class should be visible in the view of the datamodel i.e. |
java.lang.String |
toString()
Returns the name for this attribute |
void |
UpdateData(java.util.Hashtable hashNameToValues,
java.util.Hashtable hashNameaToValWhereCond)
Updates the records in the table which match the conditions in the vector. |
void |
vetoableChange(java.beans.PropertyChangeEvent propChangeEvt)
This event is fired whenever an attrib name is changed. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MANDATORY_ATTRIB_COUNT
public static final java.lang.String PROP_CLASS_NAME
public static final java.lang.String PROP_CLASS_DISPLAY
public static final java.lang.String PROP_CLASS_ATTRIB
public static final java.lang.String PROP_CLASS_CONST
public static final java.lang.String PROP_CLASS_ATTRIB_ADD
public static final java.lang.String PROP_CLASS_ATTRIB_DEL
public static final java.lang.String HWM_UNIQUE_ID
Method Detail |
---|
public void Init() throws java.lang.Exception
java.lang.Exception
public HWMDBModel GetDataModel()
public java.lang.String GetName()
public void SetName(java.lang.String strName) throws java.beans.PropertyVetoException
strName
- Name of this class.
java.beans.PropertyVetoException
- The exception thrown if a class with
similar name already existspublic java.lang.String GetDisplayName()
public void SetDisplayName(java.lang.String strDisplayName)
strDisplayName
- Display name of this class.public boolean IsEditable()
public void SetEditable(boolean bEditable)
bEditable
- If true, it can be edited else notpublic boolean IsVisible()
public void SetVisible(boolean bVisible)
bVisible
- If true, it is visible else notpublic java.lang.String GetPrimaryAttribute()
public HWMClassConstraints GetConstraints()
public int GetAttributeCount()
public HWMAttribute GetAttribute(java.lang.String strAttribName)
public java.util.Vector GetAttributes()
public HWMAttribute AddAttribute(java.lang.String strAttribName) throws java.lang.Exception
strAttribName
- The name of the attribute that should be
added to this class
java.lang.Exception
- If a class with given name already exists, an
exception is thrownpublic HWMForeignAttribute AddForeignAttribute(java.lang.String strName, HWMAttribute hwmAttrib) throws java.lang.Exception
strName
- The name for the fgn attributehwmAttrib
- An attribute to be contained in this class
java.lang.Exception
- If a class with given name already exists,
an exception is thrownpublic void RemoveAttribute(java.lang.String strAttribName) throws java.lang.Exception
strAttribName
- The name of the attribute to be removed
java.lang.Exception
public java.sql.ResultSet GetData() throws java.lang.Exception
java.lang.Exception
- If query failspublic java.sql.ResultSet GetData(java.lang.String strAttribName, java.lang.Object objValue) throws java.sql.SQLException, java.lang.Exception
strAttribName
- The name of the attributeobjValue
- The value of the attribute
java.lang.Exception
- If query fails
java.sql.SQLException
public java.sql.ResultSet GetData(java.util.Hashtable hashNameToValue) throws java.lang.Exception
hashNameToValue
- The hashtable contains the attrib name-value
pair using which a query is built.
The "and" relation is used here.
java.lang.Exception
- If query failspublic long AddData(java.util.Hashtable hashNameToValue) throws java.lang.Exception
hashNameToValue
- The hashtable contains the attrib name-value
pair to be added.
java.lang.Exception
- If hashNameToValue is null or has no elements
in it.public void UpdateData(java.util.Hashtable hashNameToValues, java.util.Hashtable hashNameaToValWhereCond) throws java.lang.Exception
hashNameToValues
- The hashtable contains the attrib name-value
pair to be added.hashNameaToValWhereCond
- The hashtable contains the attrib
name-value which forms the where condition
java.lang.Exception
- If hashNameToValue is null or has no elements
in it.public void RemoveData(java.util.Hashtable hashNameToValue) throws java.lang.Exception
hashNameToValue
- The hashtable contains the attrib name-value
pair to be removed. The "and" relation is used
between the attribs
java.lang.Exception
- If hashNameToValue is null or has no elements
in it.public java.util.Vector GetForeignAttributes()
public java.util.Vector GetRelatedClasses()
public boolean IsRelated(HWMClass hwmClass)
hwmClass
- The class to check for
public java.lang.String GetSQLRepresentation(HWMDatabaseInfo hwmDBInfo) throws java.sql.SQLException
hwmDBInfo
- The DB information required to convert the class to SQL
string
java.sql.SQLException
public void Export(org.jdom.Element elemClass)
elemClass
- The element representing this classpublic void Import(org.jdom.Element elemClass) throws java.lang.Exception
elemDM
- The element representing this class
java.lang.Exception
public void Resolve() throws java.lang.Exception
java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object
public void vetoableChange(java.beans.PropertyChangeEvent propChangeEvt) throws java.beans.PropertyVetoException
vetoableChange
in interface java.beans.VetoableChangeListener
propChangeEvt
- The property change event object
java.beans.PropertyVetoException
- The exception is thrown when the
attribute's name clashes with someother
attribute's namepublic void propertyChange(java.beans.PropertyChangeEvent propChangeEvt)
propertyChange
in interface java.beans.PropertyChangeListener
propChangeEvt
- The property change event objectpublic void addPropertyChangeListener(java.beans.PropertyChangeListener propChangeListener)
propChangeListener
- The listener for property change events fired
by this classpublic void removePropertyChangeListener(java.beans.PropertyChangeListener propChangeListener)
propChangeListener
- The listener to be removedpublic void addVetoableChangeListener(java.beans.VetoableChangeListener vetoableListener)
vetoableChangeListener
- The listener for vetoable change events
fired by this classpublic void removeVetoableChangeListener(java.beans.VetoableChangeListener vetoableListener)
vetoableListener
- The listener to be removed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |