org.hydrateframework.gen.schema
Class Relationship.Reference

java.lang.Object
  extended by org.hydrateframework.gen.schema.SchemaElementBase
      extended by org.hydrateframework.gen.schema.Relationship.Reference
All Implemented Interfaces:
Member, SchemaElement
Direct Known Subclasses:
Relationship.Reference
Enclosing class:
Relationship

public class Relationship.Reference
extends SchemaElementBase
implements Member


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.hydrateframework.gen.schema.Member
Member.CollectionType, Member.SpecialColumnType
 
Nested classes/interfaces inherited from interface org.hydrateframework.gen.schema.SchemaElement
SchemaElement.HighlightType
 
Field Summary
protected  ClassDef classDef
           
protected  java.lang.String comment
           
protected  boolean isCollection
           
protected  int isNavigable
           
protected  boolean isOptional
           
protected  java.lang.String javaVarName
           
protected  java.lang.String multiplicity
           
protected  java.lang.String name
           
protected  java.lang.String toObject
           
 
Fields inherited from class org.hydrateframework.gen.schema.SchemaElementBase
ATTR_MANDATORY, ATTR_MANDATORYNOOVR, ATTR_NOOVR, ATTR_OPTIONAL, ATTR_OPTIONALNOOVR, BOOL_FALSE, BOOL_NOT, BOOL_NOTSET, BOOL_TRUE, log, NAME, valid
 
Fields inherited from interface org.hydrateframework.gen.schema.Member
INUSE_CLASSDIAGRAM, INUSE_IMPLEMENT, INUSE_INTERFACE, INUSE_NEXT, INUSE_XMLSCHEMA
 
Constructor Summary
Relationship.Reference()
           
Relationship.Reference(Relationship.Reference override)
           
 
Method Summary
 Member.CollectionType collectionType()
          The type of collection
 boolean equals(java.lang.Object o)
           
 Member[] explode()
           
 Member[] explode(boolean collection)
           
 ClassDef getClassDef()
           
 Type getCollectionOf()
          The type of collection
 java.lang.String getComment()
          A comment that describes the purpose of this member e.g.
 SchemaElement.HighlightType getHighlightType()
           
 java.lang.String getJavaAttrName()
          The java name of the attribute.
 java.lang.String getJavaEmptyValue()
          The string that is the default value for this member in java
 java.lang.String getJavaNativeType()
          True if this member's type is a java native type
 java.lang.String getJavaNotPopulatedValue()
          The java constant that indicates that the member is 'not populated'
 java.lang.String getJavaNotSetValue()
          The java constant that indicates that the member is 'not set'.
 java.lang.String getJavaPublicType()
          The name of the type as presented in the external interface.
 java.lang.String getJavaSqlType()
           
 java.lang.String getJavaStaticName()
          The name of the static variable associated with this field in java.
 java.lang.String getJavaTypeName()
          The name of the type in Java.
 java.lang.String getJavaVarName()
          The java name of the member.
 int getLength()
          Return the length of the member.
 java.lang.String getMultiplicity()
           
 java.lang.String getName()
          The name of the member.
 Relationship.Reference getOpposingReference()
           
 SchemaElementBase getOverrides()
           
 int getPrecision()
          Return the precision of the member.
 ClassDef getReferencedClassDef()
           
 Key getReferencedKey()
           
 ClassDef getReferencingClassDef()
           
 Relationship getRelationship()
           
 int getScale()
          Return the precision of the member.
 Member.SpecialColumnType getSpecialColumnType()
          True if this is an invisible field (such as an automatically generated primary key)
 java.lang.String getSQLTypeName(SQLWriter sqlWriter)
           
 java.lang.String getTypeName()
          The type name of the member.
 java.lang.String getXSDTypeName()
           
 boolean hasDiscriminator()
           
 boolean isEnumeration()
           
 boolean isInUse(int inContext)
          true if this member is currently important to the dataset being used
 boolean isNavigable()
          Only valid if isReference is true.
 boolean isOptional()
          True if this is an optional member (may take the not set value)
 boolean isOwned()
          True if this member is owned, or has is lifecycle encapsulated by the referencing object
 boolean isPersistent()
          False if this is a transient field that is never stored in the database
 boolean isReference()
          True if this member is a reference to another hydrate object
 boolean isSupressedLink()
          true if this is a suppressed link that is not to be stored in the database
 boolean isToManyRef()
          Only valid if isReference is true.
 boolean isValid(java.lang.StringBuffer reason)
          Determine if the schema element just read is valid.
 void notifyUpdate(SchemaElement element)
          Notify a schema element that the schema element it is overriding has changed
 SchemaElement override(Family family)
          Override the schema element from ain included file.
 boolean readFromXmlDoc(java.util.Stack<java.lang.String> readContext, org.w3c.dom.Element elem)
          Read the element from the DOM model
 void resolve()
           
 void setMultiplicity(java.lang.String mult)
           
 void setName(java.lang.String nm)
           
 void setNavigable(boolean b)
           
 void setOwned(boolean b)
           
 void setReferencedClassDef(ClassDef def)
           
 void setReferencedKey(Key key)
           
 boolean shouldWrite()
           
protected  void suppressLink()
           
 java.lang.String toString()
           
 java.lang.String toSummary()
           
 java.lang.String writeAsString(java.lang.String obj)
           
 java.lang.String writeCompareTwo(java.lang.String one, java.lang.String two)
           
 java.lang.String writeCvtFromJavaObj(java.lang.String obj)
           
 java.lang.String writeCvtInternalToPublic(java.lang.String var)
          Write code that will convert the internal representation of a variable into the public representation.
 java.lang.String writeCvtPublicToInternal(java.lang.String var)
          Write code that will convert the public representation of a variable into the internal representation.
 java.lang.String writeFromString(java.lang.String obj)
           
 java.lang.String writeHashCode(java.lang.String var)
           
 java.lang.String writeJavaKeyField(java.lang.String varName)
           
 java.lang.String writeJavaSqlRead(java.lang.String rs, java.lang.String mbrIdx)
           
 java.lang.String writeJavaSqlSet(java.lang.String stmt, java.lang.String mbrIdx, java.lang.String mbrVar)
           
 java.lang.String writeJavaSqlUpdate(java.lang.String rs, java.lang.String mbrIdx, java.lang.String mbrVar)
           
 void writeToXmlDoc(SAXWriter wrt)
          Write out this schema element to the SAX Handler
 java.lang.String writeUpdFromUnderlying(java.lang.String var)
           
 void writeXSDType(SAXWriter wrt)
           
 
Methods inherited from class org.hydrateframework.gen.schema.SchemaElementBase
addBoolAttribute, addEnumAttribute, addIntAttribute, addListAttribute, addStringAttribute, isValidIdentifier, newElement, printAttrWarning, printWarning, readBoolAttribute, readEnumAttribute, readIntAttribute, readListAttribute, readStringAttribute, refEquals, supersedes
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

javaVarName

protected java.lang.String javaVarName

comment

protected java.lang.String comment

toObject

protected java.lang.String toObject

multiplicity

protected java.lang.String multiplicity

isNavigable

protected int isNavigable

isOptional

protected boolean isOptional

isCollection

protected boolean isCollection

classDef

protected ClassDef classDef
Constructor Detail

Relationship.Reference

public Relationship.Reference()

Relationship.Reference

public Relationship.Reference(Relationship.Reference override)
Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getOverrides

public SchemaElementBase getOverrides()
Specified by:
getOverrides in class SchemaElementBase

toSummary

public java.lang.String toSummary()
Specified by:
toSummary in interface SchemaElement

resolve

public void resolve()
Specified by:
resolve in interface SchemaElement

getClassDef

public ClassDef getClassDef()

getRelationship

public Relationship getRelationship()

getReferencedKey

public Key getReferencedKey()

setReferencedKey

public void setReferencedKey(Key key)

setMultiplicity

public void setMultiplicity(java.lang.String mult)

getName

public java.lang.String getName()
Description copied from interface: Member
The name of the member. This is normally in camel case e.g. dateOfBirth

Specified by:
getName in interface Member
Specified by:
getName in interface SchemaElement

getJavaVarName

public java.lang.String getJavaVarName()
Description copied from interface: Member
The java name of the member.

Specified by:
getJavaVarName in interface Member

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setName

public void setName(java.lang.String nm)

getReferencedClassDef

public ClassDef getReferencedClassDef()

setReferencedClassDef

public void setReferencedClassDef(ClassDef def)

getMultiplicity

public java.lang.String getMultiplicity()

suppressLink

protected void suppressLink()

getLength

public int getLength()
Description copied from interface: Member
Return the length of the member. e.g. the string length or total memory size of a number

Specified by:
getLength in interface Member

getPrecision

public int getPrecision()
Description copied from interface: Member
Return the precision of the member. e.g. the number of decimal digits of a number

Specified by:
getPrecision in interface Member

getScale

public int getScale()
Description copied from interface: Member
Return the precision of the member. e.g. the number of decimal places of a number

Specified by:
getScale in interface Member

isOwned

public boolean isOwned()
Description copied from interface: Member
True if this member is owned, or has is lifecycle encapsulated by the referencing object

Specified by:
isOwned in interface Member

setOwned

public void setOwned(boolean b)

getReferencingClassDef

public ClassDef getReferencingClassDef()
Specified by:
getReferencingClassDef in interface Member

getJavaTypeName

public java.lang.String getJavaTypeName()
Description copied from interface: Member
The name of the type in Java. e.g. java.util.Date

Specified by:
getJavaTypeName in interface Member

getJavaPublicType

public java.lang.String getJavaPublicType()
Description copied from interface: Member
The name of the type as presented in the external interface. This may be different from the type as stored in the object.

Specified by:
getJavaPublicType in interface Member

getJavaStaticName

public java.lang.String getJavaStaticName()
Description copied from interface: Member
The name of the static variable associated with this field in java. e.g. DATEOFBIRTH

Specified by:
getJavaStaticName in interface Member

getJavaNotSetValue

public java.lang.String getJavaNotSetValue()
Description copied from interface: Member
The java constant that indicates that the member is 'not set'. e.g. null

Specified by:
getJavaNotSetValue in interface Member

getJavaNotPopulatedValue

public java.lang.String getJavaNotPopulatedValue()
Description copied from interface: Member
The java constant that indicates that the member is 'not populated'

Specified by:
getJavaNotPopulatedValue in interface Member

getJavaAttrName

public java.lang.String getJavaAttrName()
Description copied from interface: Member
The java name of the attribute. This is normally in mixed case e.g. DateOfBirth

Specified by:
getJavaAttrName in interface Member

getComment

public java.lang.String getComment()
Description copied from interface: Member
A comment that describes the purpose of this member e.g. The date on which the individual was born

Specified by:
getComment in interface Member

isOptional

public boolean isOptional()
Description copied from interface: Member
True if this is an optional member (may take the not set value)

Specified by:
isOptional in interface Member

isSupressedLink

public boolean isSupressedLink()
Description copied from interface: Member
true if this is a suppressed link that is not to be stored in the database

Specified by:
isSupressedLink in interface Member

isReference

public boolean isReference()
Description copied from interface: Member
True if this member is a reference to another hydrate object

Specified by:
isReference in interface Member

isInUse

public boolean isInUse(int inContext)
Description copied from interface: Member
true if this member is currently important to the dataset being used

Specified by:
isInUse in interface Member

isNavigable

public boolean isNavigable()
Description copied from interface: Member
Only valid if isReference is true. Indicates that there is a get/set method for this reference

Specified by:
isNavigable in interface Member

setNavigable

public void setNavigable(boolean b)

isToManyRef

public boolean isToManyRef()
Description copied from interface: Member
Only valid if isReference is true. Indicates that the reference is a collection

Specified by:
isToManyRef in interface Member

collectionType

public Member.CollectionType collectionType()
Description copied from interface: Member
The type of collection

Specified by:
collectionType in interface Member

getCollectionOf

public Type getCollectionOf()
Description copied from interface: Member
The type of collection

Specified by:
getCollectionOf in interface Member

getJavaNativeType

public java.lang.String getJavaNativeType()
Description copied from interface: Member
True if this member's type is a java native type

Specified by:
getJavaNativeType in interface Member

getJavaEmptyValue

public java.lang.String getJavaEmptyValue()
Description copied from interface: Member
The string that is the default value for this member in java

Specified by:
getJavaEmptyValue in interface Member

getSpecialColumnType

public Member.SpecialColumnType getSpecialColumnType()
Description copied from interface: Member
True if this is an invisible field (such as an automatically generated primary key)

Specified by:
getSpecialColumnType in interface Member

getOpposingReference

public Relationship.Reference getOpposingReference()

getJavaSqlType

public java.lang.String getJavaSqlType()
Specified by:
getJavaSqlType in interface Member

writeJavaSqlUpdate

public java.lang.String writeJavaSqlUpdate(java.lang.String rs,
                                           java.lang.String mbrIdx,
                                           java.lang.String mbrVar)
Specified by:
writeJavaSqlUpdate in interface Member

writeJavaSqlRead

public java.lang.String writeJavaSqlRead(java.lang.String rs,
                                         java.lang.String mbrIdx)
Specified by:
writeJavaSqlRead in interface Member

writeCvtFromJavaObj

public java.lang.String writeCvtFromJavaObj(java.lang.String obj)
Specified by:
writeCvtFromJavaObj in interface Member

writeCvtInternalToPublic

public java.lang.String writeCvtInternalToPublic(java.lang.String var)
Description copied from interface: Member
Write code that will convert the internal representation of a variable into the public representation.

Specified by:
writeCvtInternalToPublic in interface Member

writeCvtPublicToInternal

public java.lang.String writeCvtPublicToInternal(java.lang.String var)
Description copied from interface: Member
Write code that will convert the public representation of a variable into the internal representation.

Specified by:
writeCvtPublicToInternal in interface Member

isPersistent

public boolean isPersistent()
Description copied from interface: Member
False if this is a transient field that is never stored in the database

Specified by:
isPersistent in interface Member

getTypeName

public java.lang.String getTypeName()
Description copied from interface: Member
The type name of the member. This is language independent

Specified by:
getTypeName in interface Member

explode

public Member[] explode()
Specified by:
explode in interface Member

hasDiscriminator

public boolean hasDiscriminator()

explode

public Member[] explode(boolean collection)

writeAsString

public java.lang.String writeAsString(java.lang.String obj)
Specified by:
writeAsString in interface Member

writeFromString

public java.lang.String writeFromString(java.lang.String obj)
Specified by:
writeFromString in interface Member

writeJavaKeyField

public java.lang.String writeJavaKeyField(java.lang.String varName)
Specified by:
writeJavaKeyField in interface Member

getSQLTypeName

public java.lang.String getSQLTypeName(SQLWriter sqlWriter)
Specified by:
getSQLTypeName in interface Member

writeJavaSqlSet

public java.lang.String writeJavaSqlSet(java.lang.String stmt,
                                        java.lang.String mbrIdx,
                                        java.lang.String mbrVar)
Specified by:
writeJavaSqlSet in interface Member

writeHashCode

public java.lang.String writeHashCode(java.lang.String var)
Specified by:
writeHashCode in interface Member

writeUpdFromUnderlying

public java.lang.String writeUpdFromUnderlying(java.lang.String var)
Specified by:
writeUpdFromUnderlying in interface Member

getXSDTypeName

public java.lang.String getXSDTypeName()
Specified by:
getXSDTypeName in interface Member

writeXSDType

public void writeXSDType(SAXWriter wrt)
                  throws org.xml.sax.SAXException
Specified by:
writeXSDType in interface Member
Throws:
org.xml.sax.SAXException

writeCompareTwo

public java.lang.String writeCompareTwo(java.lang.String one,
                                        java.lang.String two)
Specified by:
writeCompareTwo in interface Member

isValid

public boolean isValid(java.lang.StringBuffer reason)
Description copied from interface: SchemaElement
Determine if the schema element just read is valid.

Specified by:
isValid in interface SchemaElement
Parameters:
reason - the reason for the failure (or warning) if any should be appended to this string buffer.
Returns:
true if the element is valid, false otherwise.

notifyUpdate

public void notifyUpdate(SchemaElement element)
Description copied from interface: SchemaElement
Notify a schema element that the schema element it is overriding has changed

Specified by:
notifyUpdate in interface SchemaElement
Parameters:
element - the overridden schema element.

override

public SchemaElement override(Family family)
Description copied from interface: SchemaElement
Override the schema element from ain included file. The implementation of this method should make a new SchemaElement, that knows that it is overriding this element. It should also remember the identity of the schema element that has overridden it (i.e. the element it returns so that it can notify it via the SchemaElement.notifyUpdate(SchemaElement) method when this element changes.

Specified by:
override in interface SchemaElement
Parameters:
family - the family in which the overridden element is to be created
Returns:
the new schema element that overrides this one.

readFromXmlDoc

public boolean readFromXmlDoc(java.util.Stack<java.lang.String> readContext,
                              org.w3c.dom.Element elem)
Description copied from interface: SchemaElement
Read the element from the DOM model

Specified by:
readFromXmlDoc in interface SchemaElement
Parameters:
readContext - the context within the XML of the read operation. This is used to help pinpoint the source of an error.
elem - the DOM element to use to initialize this class.

shouldWrite

public boolean shouldWrite()
Specified by:
shouldWrite in interface SchemaElement

writeToXmlDoc

public void writeToXmlDoc(SAXWriter wrt)
                   throws org.xml.sax.SAXException
Description copied from interface: SchemaElement
Write out this schema element to the SAX Handler

Specified by:
writeToXmlDoc in interface SchemaElement
Throws:
org.xml.sax.SAXException

getHighlightType

public SchemaElement.HighlightType getHighlightType()
Specified by:
getHighlightType in interface SchemaElement

isEnumeration

public boolean isEnumeration()
Specified by:
isEnumeration in interface Member


Copyright © 2000 The Hydrate Project. All Rights Reserved.