@Test @TestForIssue(jiraKey = "HHH-11111") public void testEmbeddableCanBeResolvedWhenUsedAsInterface() { doInJPA( this::entityManagerFactory, entityManager -> { assertNotNull( entityManager.getMetamodel().embeddable( LocalizedValue.class ) ); assertEquals( LocalizedValue.class, ProductEntity_.description.getElementType().getJavaType() ); assertNotNull( LocalizedValue_.value ); } ); }
public boolean selects(Attribute<? super X, ?> attr) { boolean result = (attr instanceof MapAttribute<?, ?, ?>) && (_keyType == null || ((MapAttribute<?, ?, ?>) attr).getKeyType().getJavaType() == _keyType) && (_valueType == null || ((MapAttribute<?, ?, ?>) attr).getElementType().getJavaType() == _valueType); return _invert ? !result : result; }
public boolean selects(Attribute<? super X, ?> attr) { boolean result = (attr instanceof MapAttribute<?, ?, ?>) && (_keyType == null || ((MapAttribute<?, ?, ?>) attr).getKeyType().getJavaType() == _keyType) && (_valueType == null || ((MapAttribute<?, ?, ?>) attr).getElementType().getJavaType() == _valueType); return _invert ? !result : result; }
public boolean selects(Attribute<? super X, ?> attr) { boolean result = (attr instanceof MapAttribute<?, ?, ?>) && (_keyType == null || ((MapAttribute<?, ?, ?>) attr).getKeyType().getJavaType() == _keyType) && (_valueType == null || ((MapAttribute<?, ?, ?>) attr).getElementType().getJavaType() == _valueType); return _invert ? !result : result; }
public boolean selects(Attribute<? super X, ?> attr) { boolean result = (attr instanceof MapAttribute<?, ?, ?>) && (_keyType == null || ((MapAttribute<?, ?, ?>) attr).getKeyType().getJavaType() == _keyType) && (_valueType == null || ((MapAttribute<?, ?, ?>) attr).getElementType().getJavaType() == _valueType); return _invert ? !result : result; }
/** * Return the Map-valued attribute of the managed type that * corresponds to the specified name and Java key and value * types. * @param name the name of the represented attribute * @param keyType the key type of the represented attribute * @param valueType the value type of the represented attribute * @return MapAttribute of the given name and key and value * types * @throws IllegalArgumentException if attribute of the given * name and type is not present in the managed type */ public <K, V> MapAttribute<? super X, K, V> getMap(String name, Class<K> keyType, Class<V> valueType) { MapAttribute<? super X, K, V> anAttribute = (MapAttribute<? super X, K, V>)this.getMap(name); Class<V> aClass = anAttribute.getElementType().getJavaType(); if(valueType != aClass) { throw new IllegalArgumentException(ExceptionLocalization.buildMessage( "metamodel_managed_type_attribute_type_incorrect", new Object[] { name, this, valueType, aClass })); } return anAttribute; }
public <K, V> MapJoin<X, K, V> join(MapAttribute<? super X, K, V> map, JoinType jt) { org.eclipse.persistence.expressions.Expression node; Class clazz = map.getBindableJavaType(); MapJoin<X, K, V> join = null; if (jt.equals(JoinType.INNER)) { node = this.currentNode.anyOf(map.getName()); } else if (jt.equals(JoinType.RIGHT)) { throw new UnsupportedOperationException(ExceptionLocalization.buildMessage("RIGHT_JOIN_NOT_SUPPORTED")); } else { node = this.currentNode.anyOfAllowingNone(map.getName()); } if (map.getElementType().getPersistenceType().equals(PersistenceType.BASIC)) { join = new BasicMapJoinImpl(this, this.metamodel, clazz, node, (Bindable) map, jt); } else { join = new MapJoinImpl(this, metamodel.managedType(clazz), this.metamodel, clazz, node, (Bindable) map, jt); } this.joins.add(join); ((FromImpl)join).isJoin = true; return join; }
MapAttribute<?,?,?> map = (MapAttribute<?,?,?>) p; Type keyType = typeFactory.get(map.getKeyJavaType()); Type valueType = typeFactory.get(map.getElementType().getJavaType()); valueType = getPropertyType(p, valueType); propertyType = new SimpleType(propertyType,
MapAttribute<?,?,?> map = (MapAttribute<?,?,?>)p; Type keyType = typeFactory.get(map.getKeyJavaType()); Type valueType = typeFactory.get(map.getElementType().getJavaType()); valueType = getPropertyType(p, valueType); propertyType = new SimpleType(propertyType,