public class PModelHandle extends Object implements Serializable
PModelHandle
passes a reference to a database object:
basically, a handle to an flist, whether that flist is an
opcode return value, a POID member of another
flist, a substruct, or an array element. Because it is a handle,
it may not have actually been read from the Portal database yet,
so calls to access fields must make a connection.
A model handle provides a hash value: however, it can also be typed
to indicate the type of the object it refers to. Also, when a model
handle is created from a POID, it is very useful to use the POID's
type as the handle's type and the POID's ID as the hash value. However,
the POID's ID is a different size than provided by Object.hashCode()
.
To re-create the original POID from the model handle, the full value is needed,
which is why there are two hash
methods included in this class.
Modifier and Type | Field and Description |
---|---|
static int |
LOOKUP_DONT_UPDATE |
static int |
LOOKUP_FORCE_UPDATE |
static int |
LOOKUP_UPDATE_IF_NEEDED |
static String |
UNTYPED
A constant that provides a default value for creating an untyped model handle.
|
Modifier | Constructor and Description |
---|---|
protected |
PModelHandle()
Creates a model handle by assigning it a simple seed value.
|
protected |
PModelHandle(PModelHandle mh)
Copies a model handle.
|
protected |
PModelHandle(String type,
long hash,
boolean hashGiven,
Object model)
Initializes the model handle with
type , hash ,
and hashGiven . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other)
Overrides
Object.equals . |
long |
getHash()
Gets the actual
hashCode (a long). |
Object |
getModel() |
String |
getType()
Returns the type of model.
|
int |
hashCode()
Gets the hash value.
|
boolean |
isGivenHash()
Tests to determine if the handle was given the hash value to use.
|
String |
toString()
Gets a string representation of the model.
|
public static final String UNTYPED
public static final int LOOKUP_UPDATE_IF_NEEDED
public static final int LOOKUP_FORCE_UPDATE
public static final int LOOKUP_DONT_UPDATE
protected PModelHandle()
protected PModelHandle(PModelHandle mh)
mh
- the model handle to copypublic String getType()
String
that defines the type of model.public int hashCode()
Object.hashCode()
.public long getHash()
hashCode
(a long). This is usually called by the
framework when re-creating a POID from a model handle.hashCode
.public boolean isGivenHash()
public Object getModel()
public boolean equals(Object other)
Object.equals
. Used as an equality test.Copyright © 2003, 2023, Oracle and/or its affiliates.