query = query.multiselect(root.getModel().getIdClassAttributes().stream()// .map(it -> (Selection<?>) root.get((SingularAttribute) it).alias(it.getName())) .collect(Collectors.toList()));
@Override public List<String> getIdentifierOrUniqueKeyEmbeddedPropertyNames(EntityType<?> ownerType, String attributeName) { Attribute<?, ?> attribute = getAttribute(ownerType, attributeName); if (((SingularAttribute<?, ?>) attribute).getType() instanceof EntityType<?>) { EntityType<?> entityType = (EntityType<?>) ((SingularAttribute<?, ?>) attribute).getType(); if (entityType.hasSingleIdAttribute()) { return Collections.singletonList(entityType.getId(entityType.getIdType().getJavaType()).getName()); } else { Set<SingularAttribute<?, ?>> attributes = (Set<SingularAttribute<?, ?>>) (Set) entityType.getIdClassAttributes(); List<String> attributeNames = new ArrayList<>(attributes.size()); for (Attribute<?, ?> attr : attributes) { attributeNames.add(attr.getName()); } return attributeNames; } } return Collections.emptyList(); }
return Collections.singletonList(entityType.getId(entityType.getIdType().getJavaType()).getName()); } else { Set<SingularAttribute<?, ?>> attributes = (Set<SingularAttribute<?, ?>>) (Set) entityType.getIdClassAttributes(); List<String> attributeNames = new ArrayList<>(attributes.size());
Set<SingularAttribute<?, ?>> attributes = (Set<SingularAttribute<?, ?>>) (Set) entityType.getIdClassAttributes(); List<String> attributeNames = new ArrayList<>(attributes.size());
Set<SingularAttribute<?, ?>> attributes = (Set<SingularAttribute<?, ?>>) (Set) entityType.getIdClassAttributes(); List<String> attributeNames = new ArrayList<>(attributes.size());
query = query.multiselect(root.getModel().getIdClassAttributes().stream()// .map(it -> (Selection<?>) root.get((SingularAttribute) it).alias(it.getName())) .collect(Collectors.toList()));
for (Object obj:entity.getIdClassAttributes()) { SingularAttribute<?, ?> attr = (SingularAttribute)obj; addColumn(mf, attr.getName(), TypeFacility.getDataTypeName(getJavaDataType(attr.getJavaType())), entityTable);