*/
public static long getMaxIdForClass(
PersistenceBroker brokerForClass, ClassDescriptor cldForOriginalOrExtent, FieldDescriptor original)
throws PersistenceBrokerException
{
FieldDescriptor field = null;
if (!original.getClassDescriptor().equals(cldForOriginalOrExtent))
{
// check if extent match not the same table
if (!original.getClassDescriptor().getFullTableName().equals(
cldForOriginalOrExtent.getFullTableName()))
{
// we have to look for id's in extent class table
field = cldForOriginalOrExtent.getFieldDescriptorByName(original.getAttributeName());
}
}
else
{
field = original;
}
if (field == null)
{
// if null skip this call
return 0;
}
String column = field.getColumnName();
long result = 0;
ResultSet rs = null;
Statement stmt = null;
StatementManagerIF sm = brokerForClass.serviceStatementManager();
String table = cldForOriginalOrExtent.getFullTableName();