public static Field keyField ( Class < ? > clazz ) { for ( Field field : clazz . getDeclaredFields ( ) ) { if ( field . getAnnotation ( Key . class ) != null ) { field . setAccessible ( true ) ; fields . put ( clazz , field ) ; return field ; } } throw new IllegalArgumentException ( "Entity [" + clazz + "] must have one @org.eiichiro.acidhouse.Key field" ) ; }
Returns key field of the specified entity class .