コード例 #1
0
 @Override
 public void setValue(Object entity, Object value) {
   EntityType<Object> entityType =
       BeanLocator.getInstance().getInstance(EntityTypeRepository.class).getEntityType(entity);
   MapAttribute attribute = (MapAttribute) entityType.getAttribute(property);
   if (attribute != null) {
     attribute.putElement(entity, key, value);
   }
 }
コード例 #2
0
 @Override
 public Object getValue(Object entity) {
   EntityType<Object> entityType =
       BeanLocator.getInstance().getInstance(EntityTypeRepository.class).getEntityType(entity);
   MapAttribute attribute = (MapAttribute) entityType.getAttribute(property);
   if (attribute == null) {
     return null;
   } else {
     return attribute.getElement(entity, key);
   }
 }
コード例 #3
0
 @Override
 public J getValue(Object entity) {
   J value = null;
   if (entity instanceof JavaMetaData) {
     value = ((JavaMetaData) entity).getAnnotation(annotationType.getJavaType());
   }
   if (value == null) {
     Attribute metaAttribute = attributeType.getMetaAttribute(DerivedObject.META_ATTRIBUTE_CODE);
     if (metaAttribute != null) {
       DerivedObject derivedObject = (DerivedObject) metaAttribute.getValue(entity);
       if (derivedObject != null) {
         Object original = derivedObject.getOriginal();
         if (original != null) {
           return getValue(original);
         }
       }
     }
   }
   return value;
 }
コード例 #4
0
 @Override
 public Serializable[] getKeys(Object entity) {
   EntityType<Object> entityType = entityTypeRepository.getEntityType(entity);
   IdentityService service = entityType.getService(IdentityService.class);
   return new Serializable[] {entityType.getCode(), service.getId(entityType, entity)};
 }
コード例 #5
0
 @Override
 public <E> Serializable getId(EntityType<E> entityType, E entity) {
   return (Serializable) entityType.getAttribute(attributeCode).getValue(entity);
 }
コード例 #6
0
 @Override
 public Class<J> getReturnType() {
   return (Class<J>) annotationType.getJavaType();
 }
コード例 #7
0
 @Override
 public String getCode() {
   return annotationType.getJavaType().getName().replace(".", "_");
 }