@Override public String toClient(Object value) { return idProperty.getValue(new BeanMap(value)).toString(); }
/** * Replace the references of the given entity with persisted ones * * @param entity */ private void replaceReferences(Configuration configuration, Object entity) { BeanMap beanMap = new BeanMap(entity); MappedClass mappedClass = configuration.getMappedClass(entity.getClass()); for (MappedPath mappedPath : mappedClass.getProperties()) { if (mappedPath.isReference() && mappedPath.isSimpleProperty()) { Object value = mappedPath.getMappedProperty().getValue(beanMap); if (value != null && persisted.containsKey(value)) { value = persisted.get(value); mappedPath.getMappedProperty().setValue(beanMap, value); } } } }
if (idProperty != null) { Object id = idProperty.getValue(toBeanMap(instance)); if (id != null) { if (idProperty.getIDType() == IDType.LOCAL) {
/** * Create a new Query-by-example query * * @param session * @param entity */ @SuppressWarnings("unchecked") public ExampleQuery(Configuration configuration, Session session, T entity) { this.session = Assert.notNull(session, "session"); this.entityPath = (PathBuilder) pathBuilderFactory.create(entity.getClass()); this.conditions = new BooleanBuilder(); BeanMap beanMap = new BeanMap(entity); MappedClass mappedClass = configuration.getMappedClass(entity.getClass()); for (MappedPath mappedPath : mappedClass.getProperties()) { MappedProperty<?> property = mappedPath.getMappedProperty(); Object value = property.getValue(beanMap); if (value != null // date/time values are skipped && !DATE_TIME_TYPES.contains(value.getClass()) // collection values are skipped && !property.isCollection() // map values are skipped && !property.isMap() // blank nodes are skipped && !(value instanceof BID)) { Expression<Object> propertyPath = (Expression) entityPath.get(property.getName(), property.getType()); conditions.and(ExpressionUtils.eqConst(propertyPath, value)); } } }
Object object = property.getValue(beanMap); if (object != null) { if (property.isArray()) { Object object = property.getValue(beanMap); if (object != null) { UID subContext = getContext(object, subject, context); Map<?, ?> properties = (Map) property.getValue(beanMap); if (properties != null) { if (property.getContext() != null) {
Object mixinValue = mixinProperty.getValue(instance); if (mixinValue != null) { MappedClass mixinClass = configuration.getMappedClass(mixinProperty.getTargetType());