protected List<JPAJoinClause> generateJoinClauses() throws ODataJPARuntimeException, EdmException { List<JPAJoinClause> jpaOuterJoinClauses = new ArrayList<JPAJoinClause>(); JPAJoinClause jpaOuterJoinClause = null; String joinCondition = null; String entityAlias = generateJPAEntityAlias(); joinCondition = ODataExpressionParser.parseKeyPredicates(entitySetView.getKeyPredicates(), entityAlias); EdmEntityType entityType = entitySetView.getStartEntitySet().getEntityType(); Mapping mapping = (Mapping) entityType.getMapping(); String entityTypeName = null; if (mapping != null) { entityTypeName = mapping.getInternalName(); } else { entityTypeName = entityType.getName(); } jpaOuterJoinClause = new JPAJoinClause(entityTypeName, entityAlias, null, null, joinCondition, JPAJoinClause.JOIN.INNER); jpaOuterJoinClauses.add(jpaOuterJoinClause); for (NavigationSegment navigationSegment : entitySetView.getNavigationSegments()) { EdmNavigationProperty navigationProperty = navigationSegment.getNavigationProperty(); String relationShipAlias = generateRelationShipAlias(); joinCondition = ODataExpressionParser.parseKeyPredicates(navigationSegment.getKeyPredicates(), relationShipAlias); jpaOuterJoinClause = new JPAJoinClause(getFromEntityName(navigationProperty), entityAlias, getRelationShipName(navigationProperty), relationShipAlias, joinCondition, JPAJoinClause.JOIN.INNER); jpaOuterJoinClauses.add(jpaOuterJoinClause); } return jpaOuterJoinClauses; }
protected List<JPAJoinClause> generateJoinClauses() throws ODataJPARuntimeException, EdmException { List<JPAJoinClause> jpaOuterJoinClauses = new ArrayList<JPAJoinClause>(); JPAJoinClause jpaOuterJoinClause = null; String joinCondition = null; String entityAlias = generateJPAEntityAlias(); joinCondition = ODataExpressionParser.parseKeyPredicates(entitySetView.getKeyPredicates(), entityAlias); EdmEntityType entityType = entitySetView.getStartEntitySet().getEntityType(); Mapping mapping = (Mapping) entityType.getMapping(); String entityTypeName = null; if (mapping != null) { entityTypeName = mapping.getInternalName(); } else { entityTypeName = entityType.getName(); } jpaOuterJoinClause = new JPAJoinClause(entityTypeName, entityAlias, null, null, joinCondition, JPAJoinClause.JOIN.INNER); jpaOuterJoinClauses.add(jpaOuterJoinClause); for (NavigationSegment navigationSegment : entitySetView.getNavigationSegments()) { EdmNavigationProperty navigationProperty = navigationSegment.getNavigationProperty(); String relationShipAlias = generateRelationShipAlias(); joinCondition = ODataExpressionParser.parseKeyPredicates(navigationSegment.getKeyPredicates(), relationShipAlias); jpaOuterJoinClause = new JPAJoinClause(getFromEntityName(navigationProperty), entityAlias, getRelationShipName(navigationProperty), relationShipAlias, joinCondition, JPAJoinClause.JOIN.INNER); jpaOuterJoinClauses.add(jpaOuterJoinClause); } return jpaOuterJoinClauses; }
protected List<JPAJoinClause> generateJoinClauses() throws ODataJPARuntimeException, EdmException { List<JPAJoinClause> jpaOuterJoinClauses = new ArrayList<JPAJoinClause>(); JPAJoinClause jpaOuterJoinClause = null; String joinCondition = null; String entityAlias = generateJPAEntityAlias(); joinCondition = ODataExpressionParser.parseKeyPredicates(entityView.getKeyPredicates(), entityAlias); EdmEntityType entityType = entityView.getStartEntitySet().getEntityType(); Mapping mapping = (Mapping) entityType.getMapping(); String entityTypeName = null; if (mapping != null) { entityTypeName = mapping.getInternalName(); } else { entityTypeName = entityType.getName(); } jpaOuterJoinClause = new JPAJoinClause(entityTypeName, entityAlias, null, null, joinCondition, JPAJoinClause.JOIN.INNER); jpaOuterJoinClauses.add(jpaOuterJoinClause); for (NavigationSegment navigationSegment : entityView.getNavigationSegments()) { EdmNavigationProperty navigationProperty = navigationSegment.getNavigationProperty(); String relationShipAlias = generateRelationShipAlias(); joinCondition = ODataExpressionParser.parseKeyPredicates(navigationSegment.getKeyPredicates(), relationShipAlias); jpaOuterJoinClause = new JPAJoinClause(getFromEntityName(navigationProperty), entityAlias, getRelationShipName(navigationProperty), relationShipAlias, joinCondition, JPAJoinClause.JOIN.INNER); jpaOuterJoinClauses.add(jpaOuterJoinClause); } return jpaOuterJoinClauses; }
protected List<JPAJoinClause> generateJoinClauses() throws ODataJPARuntimeException, EdmException { List<JPAJoinClause> jpaOuterJoinClauses = new ArrayList<JPAJoinClause>(); JPAJoinClause jpaOuterJoinClause = null; String joinCondition = null; String entityAlias = generateJPAEntityAlias(); joinCondition = ODataExpressionParser.parseKeyPredicates(entityView.getKeyPredicates(), entityAlias); EdmEntityType entityType = entityView.getStartEntitySet().getEntityType(); Mapping mapping = (Mapping) entityType.getMapping(); String entityTypeName = null; if (mapping != null) { entityTypeName = mapping.getInternalName(); } else { entityTypeName = entityType.getName(); } jpaOuterJoinClause = new JPAJoinClause(entityTypeName, entityAlias, null, null, joinCondition, JPAJoinClause.JOIN.INNER); jpaOuterJoinClauses.add(jpaOuterJoinClause); for (NavigationSegment navigationSegment : entityView.getNavigationSegments()) { EdmNavigationProperty navigationProperty = navigationSegment.getNavigationProperty(); String relationShipAlias = generateRelationShipAlias(); joinCondition = ODataExpressionParser.parseKeyPredicates(navigationSegment.getKeyPredicates(), relationShipAlias); jpaOuterJoinClause = new JPAJoinClause(getFromEntityName(navigationProperty), entityAlias, getRelationShipName(navigationProperty), relationShipAlias, joinCondition, JPAJoinClause.JOIN.INNER); jpaOuterJoinClauses.add(jpaOuterJoinClause); } return jpaOuterJoinClauses; }
public static void build(final JPAEdmEntitySetView view, final JPAEdmEntityTypeView entityTypeView) { FullQualifiedName fQname = view.getEdmEntitySet().getEntityType(); JPAEdmMappingModelAccess mappingModelAccess = view.getJPAEdmMappingModelAccess(); String entitySetName = null; if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) { Mapping mapping = entityTypeView.getEdmEntityType().getMapping(); if (mapping != null) { entitySetName = mappingModelAccess.mapJPAEntitySet(mapping.getInternalName()); } } if (entitySetName == null) { entitySetName = fQname.getName(); } view.getEdmEntitySet().setName(entitySetName); }
public static void build(final JPAEdmEntitySetView view, final JPAEdmEntityTypeView entityTypeView) { FullQualifiedName fQname = view.getEdmEntitySet().getEntityType(); JPAEdmMappingModelAccess mappingModelAccess = view.getJPAEdmMappingModelAccess(); String entitySetName = null; if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) { Mapping mapping = entityTypeView.getEdmEntityType().getMapping(); if (mapping != null) { entitySetName = mappingModelAccess.mapJPAEntitySet(mapping.getInternalName()); } } if (entitySetName == null) { entitySetName = fQname.getName() + ENTITY_SET_SUFFIX; } view.getEdmEntitySet().setName(entitySetName); }
JPAEdmMapping oldMapping = (JPAEdmMapping) mapping; newMapping.setJPAColumnName(oldMapping.getJPAColumnName()); newMapping.setInternalName(embeddablePropertyName + "." + mapping.getInternalName()); newMapping.setObject(mapping.getObject()); newMapping.setJPAType(oldMapping.getJPAType()); } catch (ClassCastException e) { ComplexProperty complexProperty = (ComplexProperty) property; String name = embeddablePropertyName + "." + complexProperty.getMapping().getInternalName(); expandEdmComplexType(searchComplexTypeByName(complexProperty.getName()), expandedList, name);
JPAEdmMapping oldMapping = (JPAEdmMapping) mapping; newMapping.setJPAColumnName(oldMapping.getJPAColumnName()); newMapping.setInternalName(embeddablePropertyName + "." + mapping.getInternalName()); newMapping.setObject(mapping.getObject()); newMapping.setJPAType(oldMapping.getJPAType()); } catch (ClassCastException e) { ComplexProperty complexProperty = (ComplexProperty) property; String name = embeddablePropertyName + "." + complexProperty.getMapping().getInternalName(); expandEdmComplexType(searchComplexTypeByName(complexProperty.getName()), expandedList, name);