|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.altair.hwm.database.dbmodel.HWMDBModel
public class HWMDBModel
Title: HWMDBModel
Description: This class represents all database model. It will contain all the classes.
Company: Altair Engineering, Inc.
| Field Summary | |
|---|---|
static java.lang.String |
DM_TBL_DM_ATTRIB
The attribute name for the dm as a blob |
static java.lang.String |
DM_TBL_NAME
The table in the DB where the database model object is stored as a blob |
static java.lang.String |
PROP_DM_CLASS_ADD
The name of the property (class added) which when added, an event is fired |
static java.lang.String |
PROP_DM_CLASS_DEL
The name of the property (class removed) which when removed, an event is fired |
static java.lang.String |
PROP_MODEL_CLEAR
The property name for the event fired when the database model is cleared |
static java.lang.String |
PROP_MODEL_NAME
The property name for the name of this model |
| Constructor Summary | |
|---|---|
HWMDBModel(java.lang.String strName)
Constructor |
|
| Method Summary | |
|---|---|
HWMClass |
AddClass(java.lang.String strClassName,
boolean bRelationClass)
Add a class to the database model |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener propChangeListener)
Add property change listener |
void |
addVetoableChangeListener(java.beans.VetoableChangeListener vetoableListener)
Add vetoable change listener |
void |
ClearAll()
This is called when database model is being deleted |
void |
Export(org.jdom.Element elemDM)
Creates XML element representation of this model |
void |
Export(java.io.OutputStream os)
Export to the given output stream |
void |
Export(java.lang.String strFileName)
Export to the given file |
int |
GetClassCount()
Gets the number of classes |
DBServerComm |
GetDBServerComm()
Gets the class to be used to communicate with the database server |
HWMClass |
GetHWMClass(java.lang.String strClassName)
Gets the class with the given name |
java.util.Vector |
GetHWMClasses()
Gets all the classes in the database model. |
java.lang.String |
GetName()
Gets the name for the database model |
java.util.Vector |
GetOrderedHWMClasses()
Gets all the classes in a order such that a referenced class comes ahead of the class that references it. |
void |
Import(org.jdom.Element elemDM)
Recreates the database model |
void |
Import(java.io.InputStream is)
Import the DM from the given input stream |
void |
Import(java.lang.String strFileName)
Import the given file |
void |
Init()
Init creates the required attributes |
void |
RemoveClass(java.lang.String strClassName)
Removes a class from the class |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener propChangeListener)
Remove property change listener |
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener vetoableListener)
Remove vetoable change listener |
void |
Resolve()
Resolves the relationship classes and constraints. |
HWMClass |
ResolveDependencies(HWMClass hwmClassToAdd,
java.util.Vector vectClasses)
Addes the class to the vector in an ordered way such that any class that it depend on is ahead in the vector |
void |
SetDBServerComm(DBServerComm dbServerComm)
Sets the class to be used to communicate with the database server |
void |
SetName(java.lang.String strName)
Sets the name for the database model |
java.lang.String |
toString()
Returns the name for this class |
void |
vetoableChange(java.beans.PropertyChangeEvent propChangeEvt)
This event is fired whenever an class name is changed. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROP_MODEL_CLEAR
public static final java.lang.String PROP_MODEL_NAME
public static final java.lang.String PROP_DM_CLASS_ADD
public static final java.lang.String PROP_DM_CLASS_DEL
public static final java.lang.String DM_TBL_NAME
public static final java.lang.String DM_TBL_DM_ATTRIB
| Constructor Detail |
|---|
public HWMDBModel(java.lang.String strName)
strName - The name for the database model.| Method Detail |
|---|
public void Init()
throws java.lang.Exception
java.lang.Exceptionpublic void SetDBServerComm(DBServerComm dbServerComm)
dbServerComm - The class that helps in communicating with the
database server
public DBServerComm GetDBServerComm()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String GetName()
public void SetName(java.lang.String strName)
throws java.beans.PropertyVetoException
java.beans.PropertyVetoException - The exception thrown if a class with
similar name already existspublic int GetClassCount()
public HWMClass GetHWMClass(java.lang.String strClassName)
public java.util.Vector GetHWMClasses()
public java.util.Vector GetOrderedHWMClasses()
public HWMClass ResolveDependencies(HWMClass hwmClassToAdd,
java.util.Vector vectClasses)
throws java.lang.Exception
hwmClassToAdd - The class to add to the vectorvectOrder - The vector of classes in an order such that all
dependent classes are ahead
java.lang.Exception - If a class with given name already exists, an
exception is thrown
public HWMClass AddClass(java.lang.String strClassName,
boolean bRelationClass)
throws java.lang.Exception
strClassName - The name of the class that should be added to
this database modelbRelationClass - If this flag is true, a relationship class is
created else a plain info class is created
java.lang.Exception - If a class with given name already exists, an
exception is thrownpublic void RemoveClass(java.lang.String strClassName)
strClassName - The name of the class to be removedpublic void ClearAll()
public void Export(java.lang.String strFileName)
throws java.io.IOException
strFileName - The file name to export to
java.io.IOException
public void Export(java.io.OutputStream os)
throws java.io.IOException
os - The output stream to which the data should be written to
java.io.IOException
public void Import(java.lang.String strFileName)
throws java.io.IOException,
org.jdom.JDOMException,
java.lang.Exception
strFileName - The file name to import
java.io.IOException
org.jdom.JDOMException
java.lang.Exception
public void Import(java.io.InputStream is)
throws java.lang.Exception
is - The input stream from which the data should be retrieved
java.lang.Exception
public void Export(org.jdom.Element elemDM)
throws java.io.IOException
elemDM - The element representing this database model
java.io.IOException
public void Import(org.jdom.Element elemDM)
throws java.lang.Exception
elemDM - The element representing this database model
java.lang.Exception
public void Resolve()
throws java.lang.Exception
java.lang.Exceptionpublic 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.VetoableChangeListenerpropChangeEvt - The property change event object
java.beans.PropertyVetoException - The exception is thrown when the
class's name clashes with someother
class's namepublic 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 | |||||||||