private void checkReadonlyAccessForNativePKs ( FieldDescriptorDef fieldDef , String checkLevel ) { if ( CHECKLEVEL_NONE . equals ( checkLevel ) ) { return ; } String access = fieldDef . getProperty ( PropertyHelper . OJB_PROPERTY_ACCESS ) ; String autoInc = fieldDef . getProperty ( PropertyHelper . OJB_PROPERTY_AUTOINCREMENT ) ; if ( "database" . equals ( autoInc ) && ! "readonly" . equals ( access ) ) { LogHelper . warn ( true , FieldDescriptorConstraints . class , "checkAccess" , "The field " + fieldDef . getName ( ) + " in class " + fieldDef . getOwner ( ) . getName ( ) + " is set to database auto-increment. Therefore the field's access is set to 'readonly'." ) ; fieldDef . setProperty ( PropertyHelper . OJB_PROPERTY_ACCESS , "readonly" ) ; } }
Checks that native primarykey fields have readonly access and warns if not .