Java Code Examples for org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef#setName()

The following examples show how to use org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef#setName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClientCsdlPropertyRef.java    From olingo-odata4 with Apache License 2.0 6 votes vote down vote up
@Override
protected CsdlPropertyRef doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
        throws IOException {

  final CsdlPropertyRef propertyRef = new ClientCsdlPropertyRef();

  for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
    final JsonToken token = jp.getCurrentToken();
    if (token == JsonToken.FIELD_NAME) {
      if ("Name".equals(jp.getCurrentName())) {
        propertyRef.setName(jp.nextTextValue());
      } else if ("Alias".equals(jp.getCurrentName())) {
        propertyRef.setAlias(jp.nextTextValue());
      }
    }
  }
  return propertyRef;
}
 
Example 2
Source File: DemoEdmProvider.java    From olingo-odata4 with Apache License 2.0 6 votes vote down vote up
@Override
public CsdlEntityType getEntityType(FullQualifiedName entityTypeName) {
  // this method is called for one of the EntityTypes that are configured in the Schema
  if(ET_PRODUCT_FQN.equals(entityTypeName)){

    //create EntityType properties
    CsdlProperty id = new CsdlProperty().setName("ID").setType(EdmPrimitiveTypeKind.Int32.getFullQualifiedName());
    CsdlProperty name = new CsdlProperty().setName("Name").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());
    CsdlProperty  description = new CsdlProperty().setName("Description").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());

    // create PropertyRef for Key element
    CsdlPropertyRef propertyRef = new CsdlPropertyRef();
    propertyRef.setName("ID");

    // configure EntityType
    CsdlEntityType entityType = new CsdlEntityType();
    entityType.setName(ET_PRODUCT_NAME);
    entityType.setProperties(Arrays.asList(id, name, description));
    entityType.setKey(Collections.singletonList(propertyRef));

    return entityType;
  }

  return null;

}
 
Example 3
Source File: DemoEdmProvider.java    From olingo-odata4 with Apache License 2.0 6 votes vote down vote up
@Override
public CsdlEntityType getEntityType(FullQualifiedName entityTypeName) {
  // this method is called for one of the EntityTypes that are configured in the Schema
  if(ET_PRODUCT_FQN.equals(entityTypeName)){

    //create EntityType properties
    CsdlProperty id = new CsdlProperty().setName("ID").setType(EdmPrimitiveTypeKind.Int32.getFullQualifiedName());
    CsdlProperty name = new CsdlProperty().setName("Name").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());
    CsdlProperty  description = new CsdlProperty().setName("Description").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());

    // create PropertyRef for Key element
    CsdlPropertyRef propertyRef = new CsdlPropertyRef();
    propertyRef.setName("ID");

    // configure EntityType
    CsdlEntityType entityType = new CsdlEntityType();
    entityType.setName(ET_PRODUCT_NAME);
    entityType.setProperties(Arrays.asList(id, name, description));
    entityType.setKey(Collections.singletonList(propertyRef));

    return entityType;
  }

  return null;

}
 
Example 4
Source File: DemoEdmProvider.java    From olingo-odata4 with Apache License 2.0 6 votes vote down vote up
@Override
public CsdlEntityType getEntityType(FullQualifiedName entityTypeName) {

  // this method is called for one of the EntityTypes that are configured in the Schema
  if(entityTypeName.equals(ET_PRODUCT_FQN)){

    //create EntityType properties
    CsdlProperty id = new CsdlProperty().setName("ID").setType(EdmPrimitiveTypeKind.Int32.getFullQualifiedName());
    CsdlProperty name = new CsdlProperty().setName("Name").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());
    CsdlProperty  description = new CsdlProperty().setName("Description").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());

    // create CsdlPropertyRef for Key element
    CsdlPropertyRef propertyRef = new CsdlPropertyRef();
    propertyRef.setName("ID");

    // configure EntityType
    CsdlEntityType entityType = new CsdlEntityType();
    entityType.setName(ET_PRODUCT_NAME);
    entityType.setProperties(Arrays.asList(id, name , description));
    entityType.setKey(Collections.singletonList(propertyRef));

    return entityType;
  }

  return null;
}
 
Example 5
Source File: ProductsEdmProvider.java    From syndesis with Apache License 2.0 5 votes vote down vote up
@Override
public CsdlEntityType getEntityType(FullQualifiedName entityTypeName) {
    // this method is called for one of the EntityTypes that are configured in the Schema
    if (entityTypeName.equals(ET_PRODUCT_FQN)) {

        //create EntityType properties
        CsdlProperty id = new CsdlProperty().setName(PRODUCT_ID).setType(EdmPrimitiveTypeKind.Int32.getFullQualifiedName());
        CsdlProperty name = new CsdlProperty().setName(PRODUCT_NAME).setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());
        CsdlProperty description = new CsdlProperty().setName(PRODUCT_DESCRIPTION).setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());
        CsdlProperty serialNums = new CsdlProperty()
            .setName(PRODUCT_SERIALS)
            .setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())
            .setCollection(true);
        CsdlProperty specification = new CsdlProperty()
            .setName(PRODUCT_SPEC)
            .setType(ET_SPEC_FQN);

        // create CsdlPropertyRef for Key element
        CsdlPropertyRef propertyRef = new CsdlPropertyRef();
        propertyRef.setName(PRODUCT_ID);

        // configure EntityType
        CsdlEntityType entityType = new CsdlEntityType();
        entityType.setName(ET_PRODUCT_NAME);
        entityType.setProperties(Arrays.asList(id, name, description, serialNums, specification));
        entityType.setKey(Collections.singletonList(propertyRef));

        return entityType;
    }

    return null;
}
 
Example 6
Source File: DemoEdmProvider.java    From olingo-odata4 with Apache License 2.0 5 votes vote down vote up
@Override
public CsdlEntityType getEntityType(FullQualifiedName entityTypeName) {
  // this method is called for one of the EntityTypes that are configured in the Schema
  if(ET_PRODUCT_FQN.equals(entityTypeName)){

    //create EntityType properties
    CsdlProperty id = new CsdlProperty().setName("ID").setType(EdmPrimitiveTypeKind.Int32.getFullQualifiedName());
    CsdlProperty name = new CsdlProperty().setName("Name")
                                          .setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());
    CsdlProperty  description = new CsdlProperty().setName("Description")
                                                  .setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());

    // create PropertyRef for Key element
    CsdlPropertyRef propertyRef = new CsdlPropertyRef();
    propertyRef.setName("ID");

    // configure EntityType
    CsdlEntityType entityType = new CsdlEntityType();
    entityType.setName(ET_PRODUCT_NAME);
    entityType.setProperties(Arrays.asList(id, name, description));
    entityType.setKey(Collections.singletonList(propertyRef));

    return entityType;
  }

  return null;
}
 
Example 7
Source File: DemoEdmProvider.java    From olingo-odata4 with Apache License 2.0 5 votes vote down vote up
@Override
public CsdlEntityType getEntityType(FullQualifiedName entityTypeName) {
  // this method is called for one of the EntityTypes that are configured in the Schema
  if(ET_PRODUCT_FQN.equals(entityTypeName)){

    //create EntityType properties
    CsdlProperty id = new CsdlProperty().setName("ID")
                                        .setType(EdmPrimitiveTypeKind.Int32.getFullQualifiedName());
    CsdlProperty name = new CsdlProperty().setName("Name")
                                          .setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());
    CsdlProperty  description = new CsdlProperty().setName("Description")
                                                  .setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());

    // create PropertyRef for Key element
    CsdlPropertyRef propertyRef = new CsdlPropertyRef();
    propertyRef.setName("ID");

    // configure EntityType
    CsdlEntityType entityType = new CsdlEntityType();
    entityType.setName(ET_PRODUCT_NAME);
    entityType.setProperties(Arrays.asList(id, name, description));
    entityType.setKey(Collections.singletonList(propertyRef));

    return entityType;
  }

  return null;

}
 
Example 8
Source File: DemoEdmProvider.java    From olingo-odata4 with Apache License 2.0 5 votes vote down vote up
@Override
public CsdlEntityType getEntityType(FullQualifiedName entityTypeName) {
  // this method is called for one of the EntityTypes that are configured in the Schema
  if(entityTypeName.equals(ET_PRODUCT_FQN)){

    //create EntityType properties
    CsdlProperty id = new CsdlProperty().setName("ID")
            .setType(EdmPrimitiveTypeKind.Int32.getFullQualifiedName());
    CsdlProperty name = new CsdlProperty().setName("Name")
            .setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());
    CsdlProperty  description = new CsdlProperty().setName("Description")
            .setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());

    // create CsdlPropertyRef for Key element
    CsdlPropertyRef propertyRef = new CsdlPropertyRef();
    propertyRef.setName("ID");

    // configure EntityType
    CsdlEntityType entityType = new CsdlEntityType();
    entityType.setName(ET_PRODUCT_NAME);
    entityType.setProperties(Arrays.asList(id, name, description));
    entityType.setKey(Collections.singletonList(propertyRef));

    return entityType;
  }

  return null;

}
 
Example 9
Source File: DemoEdmProvider.java    From olingo-odata4 with Apache License 2.0 5 votes vote down vote up
@Override
public CsdlEntityType getEntityType(FullQualifiedName entityTypeName) {
  // this method is called for one of the EntityTypes that are configured in the Schema
  if (ET_PRODUCT_FQN.equals(entityTypeName)) {

    // create EntityType properties
    CsdlProperty id = new CsdlProperty().setName("ID").setType(
        EdmPrimitiveTypeKind.Int32.getFullQualifiedName());
    CsdlProperty name = new CsdlProperty().setName("Name").setType(
        EdmPrimitiveTypeKind.String.getFullQualifiedName());
    CsdlProperty description = new CsdlProperty().setName("Description").setType(
        EdmPrimitiveTypeKind.String.getFullQualifiedName());

    // create PropertyRef for Key element
    CsdlPropertyRef propertyRef = new CsdlPropertyRef();
    propertyRef.setName("ID");

    // configure EntityType
    CsdlEntityType entityType = new CsdlEntityType();
    entityType.setName(ET_PRODUCT_NAME);
    entityType.setProperties(Arrays.asList(id, name, description));
    entityType.setKey(Collections.singletonList(propertyRef));

    return entityType;
  }

  return null;

}
 
Example 10
Source File: DemoEdmProvider.java    From olingo-odata4 with Apache License 2.0 5 votes vote down vote up
@Override
public CsdlEntityType getEntityType(FullQualifiedName entityTypeName) {
  // this method is called for one of the EntityTypes that are configured in the Schema
  if(entityTypeName.equals(ET_PRODUCT_FQN)){

    //create EntityType properties
    CsdlProperty id = new CsdlProperty().setName("ID")
            .setType(EdmPrimitiveTypeKind.Int32.getFullQualifiedName());
    CsdlProperty name = new CsdlProperty().setName("Name")
            .setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());
    CsdlProperty  description = new CsdlProperty().setName("Description")
            .setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());

    // create CsdlPropertyRef for Key element
    CsdlPropertyRef propertyRef = new CsdlPropertyRef();
    propertyRef.setName("ID");

    // configure EntityType
    CsdlEntityType entityType = new CsdlEntityType();
    entityType.setName(ET_PRODUCT_NAME);
    entityType.setProperties(Arrays.asList(id, name, description));
    entityType.setKey(Collections.singletonList(propertyRef));

    return entityType;
  }

  return null;

}
 
Example 11
Source File: DemoEdmProvider.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Override
public CsdlEntityType getEntityType(FullQualifiedName entityTypeName) {

    // this method is called for one of the EntityTypes that are configured in the Schema
    if (entityTypeName.equals(ET_PRODUCT_FQN)) {

        //create EntityType properties
        CsdlProperty id = new CsdlProperty()
            .setName("ID")
            .setType(EdmPrimitiveTypeKind.Int32.getFullQualifiedName());
        CsdlProperty name = new CsdlProperty()
            .setName("Name")
            .setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());
        CsdlProperty description = new CsdlProperty()
            .setName("Description")
            .setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());

        // create CsdlPropertyRef for Key element
        CsdlPropertyRef propertyRef = new CsdlPropertyRef();
        propertyRef.setName("ID");

        // configure EntityType
        CsdlEntityType entityType = new CsdlEntityType();
        entityType.setName(ET_PRODUCT_NAME);
        entityType.setProperties(Arrays.asList(id, name, description));
        entityType.setKey(Collections.singletonList(propertyRef));

        return entityType;
    }

    return null;
}