}
private static boolean checkActiveArrayObjectUnchanged(JODBOperationContext context, Object array, ObjectDataContainer objectDataContainer, ClassDescriptor classDescriptor) throws IOException, IllegalClassTypeException{
//TODO make size estimation here?
int arraySize = Array.getLength(array);
FieldsIterator fieldsIterator = objectDataContainer.getActiveFieldsIterator();
if(fieldsIterator == null){
return false;//TODO add warning?
}
if(arraySize!=fieldsIterator.getRemainingInCurrentCategory()){
return true;
}
IOBase base = context.getBase();
JODBSession session = context.getSession();
FieldRecord fieldRecord = objectDataContainer.getRecordCache();
if( !classDescriptor.getArrayType().isPrimitive() ){
for (int i = 0; i < arraySize; i++) {
fieldsIterator.next(fieldRecord, base);
Object value = Array.get(array, i);
if(value == null){
if(fieldRecord._objectOffset!=0){
return false;
}
continue;
}
PersistentObjectHandle handle = session.getHandleForActiveObject(value);
if(handle == null || handle.getObjectEntryOffset() != fieldRecord._objectOffset){
return false;
}
}
}else{
PRIMITIVES_ENUMERATION enumeratedPrimitiveType = PrimitiveJavaTypesUtil.getEnumeratedType(classDescriptor.getArrayType().getName());
for (int i = 0; i < arraySize; i++) {
fieldsIterator.next(fieldRecord, base, false);
Object value = Array.get(array, i);
if( PrimitiveJavaTypesUtil.comparePrimitives(value, enumeratedPrimitiveType, fieldRecord._primitiveRawDataBuffer) != 0 ){
return false;
}
}