Maximo best practice - correct use of unique ids in java code to avoid possible bugs
MikhailRaikhline 270000N1J6 Visits (3621)
1. Java code
In Maximo java classes we don't always use the right method to get the unique id value: it always has to be getLong("<uniqid>") .
In the recent code you may find getInt (mostly), getDouble, or even getString to get the unique id value, which can lead to run time errors (and PMRs) in the future (we already fixed (and hotfixed) many issues happening because of that).
Sometime in MAXATTRIBUTE table we don't have sameas definition (sameasobject=null, same
For ex.: PURCHVIEW / CONTRACTID is a reference to CONTRACT / CONTRACTID.
In this case integrity checker doesn't validate the maxtype of this attribute.
Please run the following statement to find such an issue
select a.objectname, a.attributename, a.maxtype, t.tablename, t.uniquecolumnname ,b.maxtype
from maxattribute a, maxtable t, maxattribute b
where a.attributename = t.uniquecolumnname
and a.objectname <> t.tablename
and a.sameasobject is null
and b.attributename = a.attributename
and b.objectname = t.tablename
and a.maxtype <> b.maxtype
order by 2, 1;
This select above is our "best guess" statement. If you know other broken MAXTYPE definition related to BIGINT - please fix it, too. A couple of examples we found that are not in this list is LONG