protected void checkForPrimaryKeys ( final Object realObject ) throws ClassNotPersistenceCapableException { // if no PKs are specified OJB can't handle this class ! if ( m_pkValues == null || m_pkValues . length == 0 ) { throw createException ( "OJB needs at least one primary key attribute for class: " , realObject , null ) ; } // arminw: should never happen // if(m_pkValues[0] instanceof ValueContainer) // throw new OJBRuntimeException("Can't handle pk values of type "+ValueContainer.class.getName()); }
OJB can handle only classes that declare at least one primary key attribute this method checks this condition .