private boolean validateCompatibleWithTableOccVersion ( EntitySchema entitySchema1 , EntitySchema entitySchema2 ) { boolean foundOccMapping = false ; for ( FieldMapping fieldMapping : entitySchema1 . getColumnMappingDescriptor ( ) . getFieldMappings ( ) ) { if ( fieldMapping . getMappingType ( ) == MappingType . OCC_VERSION ) { foundOccMapping = true ; break ; } } if ( foundOccMapping ) { for ( FieldMapping fieldMapping : entitySchema2 . getColumnMappingDescriptor ( ) . getFieldMappings ( ) ) { if ( fieldMapping . getMappingType ( ) == MappingType . OCC_VERSION ) { LOG . warn ( "Field: " + fieldMapping . getFieldName ( ) + " in schema " + entitySchema2 . getName ( ) + " conflicts with an occVersion field in " + entitySchema1 . getName ( ) ) ; return false ; } } } return true ; }
Only one schema for a table should contain an OCCVersion field mapping . This method will compare two schemas and return true if only one has an OCC_VERSION field .