A set of interactions indicates how to manipulate member
records.
The following interactions pertain to manipulating
member records. Most of the examples assume that the member is a person
that has attributes such as birth date, sex, age, and so on.
The examples instantiate one or more MemHead objects,
used to create new members. MemHead has three constructors:
- MemHead() – Creates a MemHead object
and sets a temporary memRecno. When the MemHead is inserted into the
database, the temporary memRecno is converted to the next available
number. This one is most commonly used in the examples.
- MemHead (long memRecno) – Creates a
MemHead object and sets the specified memRecno. (If this value is
zero (0), then a reserved memRecno is generated. When the MemHead
is inserted into the database, the memRecno is converted to the next
available number.)
- MemHead (long memRecno, long entRecno) – Creates a
MemHead object and sets the specified memRecno and entRecno. (If the
memRecno or entRecno value is zero (0), then a reserved memRecno or
entRecno is generated. When the MemHead is inserted into the database,
the memRecno or entRecno is converted to the next available number.)
MemName and MemDate objects are frequently used
as well.
MemName has four constructors, but only
one is used in the examples. Consult the Javadoc for information about
the other constructors.
- public MemName(MemHead memHead) –
Constructs a MemName object and sets the member identification info.
The MemRecno and EntRecno information is set using the MemHead object.
MemDate has four constructors, but only one
is used in the examples. Consult the Javadoc HTML documentation for information
about the other constructors.
- public MemDate(MemHead memHead) –
Constructs a MemDate object and sets the member identification info.
The MemRecno and EntRecno information is set using the MemHead object.
Note: When storing dates in the Master Data Engine, use the normalized
format YYYY-MM-DD. If dates are stored in other
formats, they might not be caught by dateval validation and won't
be displayed properly in client applications, such as Inspector.
This
example code provided with the SDK:
MemAttrRow memDate = getDicStore().createMemAttrRowByName("Birth Date", memHead);
memDate.setString("dateVal", "17-08-1973");
should instead
read:
MemDate memDate = new MemDate();
memDate.setDateVal("dateVal", "1973-08-17");
See the "mpi_memdate and mpi_memdate_h" topic within
the Data Model Description, and the madison.mpi.MemDate class in the
Javadoc Information for details.