public String getFQBaseTypeName() { return baseTypeNameFQ != null ? baseTypeNameFQ : (baseType != null ? baseType.getFullyQualifiedTypeName() : null); }
public String getFQBaseTypeName() { return baseTypeNameFQ != null ? baseTypeNameFQ : (baseType != null ? baseType.getFullyQualifiedTypeName() : null); }
public String getFQBaseTypeName() { return baseTypeNameFQ != null ? baseTypeNameFQ : (baseType != null ? baseType.getFullyQualifiedTypeName() : null); }
public String getFQBaseTypeName() { return baseTypeNameFQ != null ? baseTypeNameFQ : (baseType != null ? baseType.getFullyQualifiedTypeName() : null); }
public String getFQBaseTypeName() { return baseTypeNameFQ != null ? baseTypeNameFQ : (baseType != null ? baseType.getFullyQualifiedTypeName() : null); }
public String getFQBaseTypeName() { return baseTypeNameFQ != null ? baseTypeNameFQ : (baseType != null ? baseType.getFullyQualifiedTypeName() : null); }
boolean same(EdmEntityType x, EdmEntityType y) { return (x.getFullyQualifiedTypeName().equalsIgnoreCase(y.getFullyQualifiedTypeName())); }
public EdmType findEdmEntityType(String fqName) { for (EdmSchema schema : this.schemas) { for (EdmEntityType et : schema.getEntityTypes()) { if (et.getFullyQualifiedTypeName().equals(fqName)) { return et; } } } return null; }
public EdmType findEdmEntityType(String fqName) { for (EdmSchema schema : this.schemas) { for (EdmEntityType et : schema.getEntityTypes()) { if (et.getFullyQualifiedTypeName().equals(fqName)) { return et; } } } return null; }
public EdmType findEdmEntityType(String fqName) { for (EdmSchema schema : this.schemas) { for (EdmEntityType et : schema.getEntityTypes()) { if (et.getFullyQualifiedTypeName().equals(fqName)) { return et; } } } return null; }
public FeedCustomization get(EdmEntityType eet) { if (eet == null) return null; if (cache == null) cache = new HashMap<String, FeedCustomization>(); String key = eet.getFullyQualifiedTypeName(); FeedCustomization value = cache.get(key); if (value == null) { value = computeFeedCustomization(metadata, eet); cache.put(key, value); } return value; }
public FeedCustomization get(EdmEntityType eet) { if (eet == null) return null; if (cache == null) cache = new HashMap<String, FeedCustomization>(); String key = eet.getFullyQualifiedTypeName(); FeedCustomization value = cache.get(key); if (value == null) { value = computeFeedCustomization(metadata, eet); cache.put(key, value); } return value; }
private Table getEntityTable(MetadataFactory mf, EdmEntityType toEntity) throws TranslatorException { for (Table t:mf.getSchema().getTables().values()) { if (t.getProperty(ENTITY_TYPE, false).equals(toEntity.getFullyQualifiedTypeName())){ return t; } } throw new TranslatorException(ODataPlugin.Util.gs(ODataPlugin.Event.TEIID17004, toEntity.getFullyQualifiedTypeName())); }
public static String getEntityRelId(EdmEntitySet entitySet, OEntityKey entityKey) { String key = entityKey.toKeyString(); return entitySet.getType().getFullyQualifiedTypeName() + key; }
protected void resolveEntityType(JsonEntry entry) { // does the metadata refine the type of entity to expect? if (entry.jemd != null && entry.jemd.type != null && !entry.getEntitySet().getType().getFullyQualifiedTypeName().equals(entry.jemd.type)) { // yes it does. entry.setEntityType((EdmEntityType) this.metadata.findEdmEntityType(entry.jemd.type)); if (entry.getEntityType() == null) { throw new IllegalArgumentException("failed resolving type: " + entry.jemd.type); } } else { entry.setEntityType(entry.getEntitySet().getType()); } }
protected void resolveEntityType(JsonEntry entry) { // does the metadata refine the type of entity to expect? if (entry.jemd != null && entry.jemd.type != null && !entry.getEntitySet().getType().getFullyQualifiedTypeName().equals(entry.jemd.type)) { // yes it does. entry.setEntityType((EdmEntityType) this.metadata.findEdmEntityType(entry.jemd.type)); if (entry.getEntityType() == null) { throw new IllegalArgumentException("failed resolving type: " + entry.jemd.type); } } else { entry.setEntityType(entry.getEntitySet().getType()); } }
private Object resolveStructuralTypeVariable(EdmStructuralType et, PropertyPath path) { if (path.getNComponents() == 1) { String name = path.getLastComponent(); if (Edm.EntityType.Abstract.equals(name)) { return et.getIsAbstract() == null ? false : et.getIsAbstract(); } else if (Edm.EntityType.BaseType.equals(name)) { return et.getBaseType() == null ? null : et.getBaseType().getFullyQualifiedTypeName(); } else if (Edm.EntityType.Name.equals(name)) { return et.getName(); } else if (Edm.EntityType.Namespace.equals(name)) { return et.getNamespace(); } else { // see if our decorator has an annotation that works try { return decorator.resolveStructuralTypeProperty(et, path); } catch (Exception ex) { throw new RuntimeException("EdmEntityType property " + name + " not found"); } } } else { String navProp = path.getFirstComponent(); // --to 1 props only // TODO: superclass maybe throw new RuntimeException("EdmEntityType navigation property " + navProp + " not found or not supported"); } }
private Object resolveStructuralTypeVariable(EdmStructuralType et, PropertyPath path) { if (path.getNComponents() == 1) { String name = path.getLastComponent(); if (Edm.EntityType.Abstract.equals(name)) { return et.getIsAbstract() == null ? false : et.getIsAbstract(); } else if (Edm.EntityType.BaseType.equals(name)) { return et.getBaseType() == null ? null : et.getBaseType().getFullyQualifiedTypeName(); } else if (Edm.EntityType.Name.equals(name)) { return et.getName(); } else if (Edm.EntityType.Namespace.equals(name)) { return et.getNamespace(); } else { // see if our decorator has an annotation that works try { return decorator.resolveStructuralTypeProperty(et, path); } catch (Exception ex) { throw new RuntimeException("EdmEntityType property " + name + " not found"); } } } else { String navProp = path.getFirstComponent(); // --to 1 props only // TODO: superclass maybe throw new RuntimeException("EdmEntityType navigation property " + navProp + " not found or not supported"); } }
protected void writeOEntity(UriInfo uriInfo, JsonWriter jw, OEntity oe, EdmEntitySet ees, boolean isResponse) { jw.startObject(); { String baseUri = null; // TODO: I'm keeping this pattern of writing the __metadata if we have a non-null type..it seems like we could still // write the uri even if we don't have a type. Also, are there any scenarios where the entity type would be null? Not sure. if (isResponse && oe.getEntityType() != null) { baseUri = uriInfo.getBaseUri().toString(); jw.writeName("__metadata"); jw.startObject(); { String absId = baseUri + InternalUtil.getEntityRelId(oe); jw.writeName("uri"); jw.writeString(absId); jw.writeSeparator(); jw.writeName("type"); jw.writeString(oe.getEntityType().getFullyQualifiedTypeName()); } jw.endObject(); jw.writeSeparator(); } writeOProperties(jw, oe.getProperties()); writeLinks(jw, oe, uriInfo, isResponse); } jw.endObject(); }
protected void writeOEntity(UriInfo uriInfo, JsonWriter jw, OEntity oe, EdmEntitySet ees, boolean isResponse) { jw.startObject(); { String baseUri = null; // TODO: I'm keeping this pattern of writing the __metadata if we have a non-null type..it seems like we could still // write the uri even if we don't have a type. Also, are there any scenarios where the entity type would be null? Not sure. if (isResponse && oe.getEntityType() != null) { baseUri = uriInfo.getBaseUri().toString(); jw.writeName("__metadata"); jw.startObject(); { String absId = baseUri + InternalUtil.getEntityRelId(oe); jw.writeName("uri"); jw.writeString(absId); jw.writeSeparator(); jw.writeName("type"); jw.writeString(oe.getEntityType().getFullyQualifiedTypeName()); } jw.endObject(); jw.writeSeparator(); } writeOProperties(jw, oe.getProperties()); writeLinks(jw, oe, uriInfo, isResponse); } jw.endObject(); }