@ SuppressWarnings ( "unchecked" ) public void setDefaults ( Class < T > realClass ) { this . realClass = realClass ; this . keyDef = new KeyDefinition ( ) ; // find the "effective" class - skipping up the hierarchy over inner classes effectiveClass = realClass ; boolean entityFound ; while ( ! ( entityFound = ( null != effectiveClass . getAnnotation ( Entity . class ) ) ) ) { // TODO:BTB this might should be isSynthetic if ( ! effectiveClass . isAnonymousClass ( ) ) { break ; } else { effectiveClass = ( Class < T > ) effectiveClass . getSuperclass ( ) ; } } // if class is missing @Entity, then proceed no further if ( ! entityFound ) { throw new HomMissingEntityAnnotationException ( "class, " + realClass . getName ( ) + ", not annotated with @" + Entity . class . getSimpleName ( ) ) ; } }
Setup mapping with defaults for the given class . Does not parse all annotations .