public boolean isAbleToStore(Object value) { if (value == null) { return true; } return mappings.isJPAEntity(value); }
@Override public boolean isAbleToStore(Object value) { boolean canStore = false; if (value instanceof List<?>) { List<?> list = (List<?>) value; if (list.size() > 0) { // We can only store the list if we are sure it's actually a // list of JPA entities. In case the // list is empty, we don't store it. canStore = true; Class<?> entityClass = mappings.getEntityMetaData(list.get(0).getClass()).getEntityClass(); for (Object entity : list) { canStore = entity != null && mappings.isJPAEntity(entity) && mappings.getEntityMetaData(entity.getClass()).getEntityClass().equals(entityClass); if (!canStore) { // In case the object is not a JPA entity or the class // doesn't match, we can't store the list break; } } } } return canStore; }
public boolean isAbleToStore(Object value) { if (value == null) { return true; } return mappings.isJPAEntity(value); }
public boolean isAbleToStore(Object value) { if(value == null) { return true; } return mappings.isJPAEntity(value); }
@Override public boolean isAbleToStore(Object value) { if (value == null) { return true; } return mappings.isJPAEntity(value); }
@Override public boolean isAbleToStore(Object value) { boolean canStore = false; if (value instanceof List<?>) { List<?> list = (List<?>) value; if (list.size() > 0) { // We can only store the list if we are sure it's actually a // list of JPA entities. In case the // list is empty, we don't store it. canStore = true; Class<?> entityClass = mappings.getEntityMetaData(list.get(0).getClass()).getEntityClass(); for (Object entity : list) { canStore = entity != null && mappings.isJPAEntity(entity) && mappings.getEntityMetaData(entity.getClass()).getEntityClass().equals(entityClass); if (!canStore) { // In case the object is not a JPA entity or the class // doesn't match, we can't store the list break; } } } } return canStore; }