HHH-4846 fix NPE and also address JCTS-946

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18630 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Scott Marlow 2010-01-26 14:51:54 +00:00
parent 2adcb4d926
commit 82c5616343
1 changed files with 2 additions and 4 deletions

View File

@ -241,10 +241,8 @@ public abstract class AbstractIdentifiableType<X>
* super class.
*/
protected void checkDeclaredVersion() {
if ( version == null ) {
if ( getSupertype() != null && getSupertype().hasVersionAttribute() ) {
throw new IllegalArgumentException( "The version attribute is not declared on this type" );
}
if ( version == null || ( getSupertype() != null && getSupertype().hasVersionAttribute() )) {
throw new IllegalArgumentException( "The version attribute is not declared on this type" );
}
}