|
||||||||||
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)
Deprecated. |
int |
getFieldCount()
Gets the number of 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. |
boolean |
getIsUnique()
returns whether or not the key is known to be a uniqueness key. |
java.lang.String |
getName()
Gets the name of the Key. |
ViewKeys |
getParent()
Deprecated. |
IViewField |
getViewField(int index)
Gets the IViewField of the given key field. |
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 |
---|
@Deprecated public ViewField getField(int index)
ViewField
object of the given key field. The field is
identified by the zero-based index in the key.
This method is deprecated; use getViewField(int)
instead
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.
ViewField
java.lang.IndexOutOfBoundsException
- if the index is not validgetFieldCount()
public int getFieldCount()
getFieldCount
in interface IViewKey
IViewKey.getViewField(int)
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.
getHeaderFieldCount
in interface IViewKey
public int getID()
getID
in interface IViewKey
public boolean getIsUnique()
getIsUnique
in interface IViewKey
true
if the key is known to be a uniqueness key,
false
if the key is known to be not a uniqueness key, or
if it is unclear whether or not it isIViewKey.setIsUnique(boolean)
public java.lang.String getName()
getName
in interface IViewKey
@Deprecated public ViewKeys getParent()
This is deprecated; backward navigation should not be necessary
ViewKeys
provided at construction timepublic IViewField getViewField(int index)
IViewField
of the given key field. The field is
identified by the zero-based index in the key.
getViewField
in interface IViewKey
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.
IViewField
corresponding to the indexIViewKey.getFieldCount()
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.
setHeaderFieldCount
in interface IViewKey
count
- the number of leading fields that are a reference to the header
or parent view.public void setIsUnique(boolean isUnique)
This must not be called on the primary key (the first in the collection) and may be called at most once on any other key.
setIsUnique
in interface IViewKey
isUnique
- true if the key is known to be a uniqueness key and false if it
is known to be not a uniqueness key.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |