@Test public void shouldNotRecognizeEntityAnnotationWhenFileMetadataIsEmpty() { AnnotationObject result = mdsJdoAnnotationReader.isClassPersistable(Record.class); assertNull(result); }
@Override protected AnnotationObject isClassPersistable(Class cls) { AnnotationObject annotationObject = super.isClassPersistable(cls); if (annotationObject == null && ReflectionsUtil.hasAnnotation(cls, Entity.class) && !ArrayUtils.isEmpty(mgr.getFileMetaData())) { HashMap<String, Object> annotationParams = new HashMap<>(); annotationParams.put("identityType", IdentityType.DATASTORE); Class superClass = cls.getSuperclass(); while (superClass != null) { if (superClass == MdsEntity.class || superClass == MdsVersionedEntity.class) { annotationParams.put("identityType", IdentityType.APPLICATION); } superClass = superClass.getSuperclass(); } annotationParams.put("detachable", Constants.Util.TRUE); annotationObject = new AnnotationObject(PersistenceCapable.class.getName(), annotationParams); } return annotationObject; }
MdsJdoAnnotationReader extends JDOAnnotationReader { @Override protected AnnotationObject isClassPersistable(Class cls) { AnnotationObject annotationObject = super.isClassPersistable(cls); if (annotationObject == null && ReflectionsUtil.hasAnnotation(cls, Entity.class) && !ArrayUtils.isEmpty(mgr.getFileMetaData())) { HashMap<String, Object> annotationParams = new HashMap<>(); annotationParams.put("identityType", IdentityType.DATASTORE); Class superClass = cls.getSuperclass(); while (superClass != null) { if (superClass == MdsEntity.class || superClass == MdsVersionedEntity.class) { annotationParams.put("identityType", IdentityType.APPLICATION); } superClass = superClass.getSuperclass(); } annotationParams.put("detachable", Constants.Util.TRUE); annotationObject = new AnnotationObject(PersistenceCapable.class.getName(), annotationParams); } return annotationObject; } }
MdsJdoAnnotationReader extends JDOAnnotationReader { @Override protected AnnotationObject isClassPersistable(Class cls) { AnnotationObject annotationObject = super.isClassPersistable(cls); if (annotationObject == null && ReflectionsUtil.hasAnnotation(cls, Entity.class) && !ArrayUtils.isEmpty(mgr.getFileMetaData())) { HashMap<String, Object> annotationParams = new HashMap<>(); annotationParams.put("identityType", IdentityType.DATASTORE); Class superClass = cls.getSuperclass(); while (superClass != null) { if (superClass == MdsEntity.class || superClass == MdsVersionedEntity.class) { annotationParams.put("identityType", IdentityType.APPLICATION); } superClass = superClass.getSuperclass(); } annotationParams.put("detachable", Constants.Util.TRUE); annotationObject = new AnnotationObject(PersistenceCapable.class.getName(), annotationParams); } return annotationObject; } MdsJdoAnnotationReader(MetaDataManager mgr); }
MdsJdoAnnotationReader extends JDOAnnotationReader { @Override protected AnnotationObject isClassPersistable(Class cls) { AnnotationObject annotationObject = super.isClassPersistable(cls); if (annotationObject == null && ReflectionsUtil.hasAnnotation(cls, Entity.class) && !ArrayUtils.isEmpty(mgr.getFileMetaData())) { HashMap<String, Object> annotationParams = new HashMap<>(); annotationParams.put("identityType", IdentityType.DATASTORE); Class superClass = cls.getSuperclass(); while (superClass != null) { if (superClass == MdsEntity.class || superClass == MdsVersionedEntity.class) { annotationParams.put("identityType", IdentityType.APPLICATION); } superClass = superClass.getSuperclass(); } annotationParams.put("detachable", Constants.Util.TRUE); annotationObject = new AnnotationObject(PersistenceCapable.class.getName(), annotationParams); } return annotationObject; } MdsJdoAnnotationReader(MetaDataManager mgr);  }
MdsJdoAnnotationReader extends JDOAnnotationReader { @Override protected AnnotationObject isClassPersistable(Class cls) { AnnotationObject annotationObject = super.isClassPersistable(cls); if (annotationObject == null && ReflectionsUtil.hasAnnotation(cls, Entity.class) && !ArrayUtils.isEmpty(mgr.getFileMetaData())) { HashMap<String, Object> annotationParams = new HashMap<>(); annotationParams.put("identityType", IdentityType.DATASTORE); Class superClass = cls.getSuperclass(); while (superClass != null) { if (superClass == MdsEntity.class || superClass == MdsVersionedEntity.class) { annotationParams.put("identityType", IdentityType.APPLICATION); } superClass = superClass.getSuperclass(); } annotationParams.put("detachable", Constants.Util.TRUE); annotationObject = new AnnotationObject(PersistenceCapable.class.getName(), annotationParams); } return annotationObject; } MdsJdoAnnotationReader(MetaDataManager mgr);   }