|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sage.accpac.sm.ViewKey
@ThreadSafe public final class ViewKey
Represents a key defined in an Accpac view
An instance of this class cannot be created directly by applications. It must
be obtained from an instance of the ViewKeys
class via the
View.getKeys()
method.
Since not all required information is currently available from the underlying
views the caller may use setIsUnique(boolean)
and
setHeaderFieldCount(int)
to set these properties.
If the View.refreshSchema()
method is called then any instance of
this class will be invalidated.
Method Summary | |
---|---|
ViewField |
getField(int index)
Gets the ViewField object of the given key field. |
int |
getFieldCount()
Gets the number of key fields in the key |
int |
getHeaderFieldCount()
gets the number of leading fields that are a reference to the header view. |
int |
getID()
Gets the ID of the key. |
java.lang.String |
getName()
Gets the name of the Key. |
ViewKeys |
getParent()
Gets the ViewKeys collection object from which this object was obtained. |
void |
setHeaderFieldCount(int count)
allows the caller to inform the key of how many of the leading fields are a reference to its header or parent view. |
void |
setIsUnique(boolean isUnique)
allows the caller to inform the key of whether or not it is a uniqueness key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public ViewField getField(int index)
ViewField
object of the given key field. The field is
identified by the zero-based index in the key.
index
- the zero-based index of the field to get. This is the zero-based
index within this key, not within the View's fields.
java.lang.IndexOutOfBoundsException
- if the index is not validgetFieldCount()
public int getFieldCount()
public int getHeaderFieldCount()
A view can have a header view, a view that is a parent to this view. For example the header of a batch entry is the batch itself, and the header of an order detail line is the order itself. When putting data to the key fields there is generally no need to put to those fields that are references to the parent and indeed for some protocols doing so might result in an error. Use this function to find out how many of the leading fields of the current key will be set by the parent.
Normally this only makes sense on the primary key, but by allowing this to be a measure of any key we allow for different headers depending on how the view is being viewed.
public int getID()
public java.lang.String getName()
public ViewKeys getParent()
public void setHeaderFieldCount(int count)
Note how a view may have a different header view, depending upon which key is being used to refer to it.
count
- the number of leading fields that are a reference to the header
or parent view.public void setIsUnique(boolean isUnique)
isUnique
- true if the key is known to be a uniqueness key and false if it
is known to be not a uniqueness key.
java.lang.IllegalStateException
- if this is a primary key or if the key has already been
informed (even if the values agree)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |