org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmSchemaView Java Examples

The following examples show how to use org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmSchemaView. 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: JPAEdmExtension.java    From odata-boilerplate with MIT License 6 votes vote down vote up
@Override
public void extendJPAEdmSchema(JPAEdmSchemaView view) {
	ResourceBundle i18n = ODataContextUtil.getResourceBundle("i18n");
	final Schema edmSchema = view.getEdmSchema();
	
	for (EntityType entityType : edmSchema.getEntityTypes()) {
		for (Property property : entityType.getProperties()) {
			String label = null;
			if (i18n != null) { try { label = i18n.getString(entityType.getName() + "." + property.getName()); } catch (Exception e) {} }
			List<AnnotationAttribute> annotationAttributeList = new ArrayList<AnnotationAttribute>();
			if (label != null) {
				annotationAttributeList.add(new AnnotationAttribute()
						.setNamespace(SAP_NAMESPACE)
						.setPrefix(SAP_PREFIX)
						.setName(LABEL).setText(label));
			}
			annotationAttributeList.addAll(getSapPropertyAnnotations(entityType, property));
			property.setAnnotationAttributes(annotationAttributeList); 
		}
	}
	
	addSmartAnnotations(edmSchema);
}
 
Example #2
Source File: EspmProcessingExtension.java    From cloud-espm-v2 with Apache License 2.0 5 votes vote down vote up
/**
 * Register function imports.
 */

@Override
public void extendWithOperation(JPAEdmSchemaView view) {
	view.registerOperations(CustomerProcessor.class, null);
	view.registerOperations(SalesOrderProcessor.class, null);
	view.registerOperations(CustomerReviewProcessor.class, null);

}
 
Example #3
Source File: JPAEdmComplexType.java    From olingo-odata2 with Apache License 2.0 5 votes vote down vote up
public JPAEdmComplexType(final JPAEdmSchemaView view) {
  super(view);
  schemaView = view;
  directBuild = true;
  if (nonKeyComplexList == null) {
    nonKeyComplexList = new ArrayList<String>();
  }
}
 
Example #4
Source File: JPAEdmComplexType.java    From olingo-odata2 with Apache License 2.0 5 votes vote down vote up
public JPAEdmComplexType(final JPAEdmSchemaView view, final Attribute<?, ?> complexAttribute) {
  super(view);
  schemaView = view;
  for (EmbeddableType<?> jpaEmbeddable : schemaView.getJPAMetaModel().getEmbeddables()) {
    if (jpaEmbeddable.getJavaType().getName().equals(complexAttribute.getJavaType().getName())) {
      nestedComplexType = jpaEmbeddable;
      break;
    }
  }
  directBuild = false;
  if (nonKeyComplexList == null) {
    nonKeyComplexList = new ArrayList<String>();
  }
}
 
Example #5
Source File: JPAEdmProperty.java    From olingo-odata2 with Apache License 2.0 5 votes vote down vote up
public JPAEdmProperty(final JPAEdmSchemaView schemaView,
    final JPAEdmComplexTypeView view) {
  super(view);
  this.schemaView = schemaView;
  complexTypeView = view;
  isBuildModeComplexType = true;
}
 
Example #6
Source File: JPAEdmProperty.java    From olingo-odata2 with Apache License 2.0 5 votes vote down vote up
public JPAEdmProperty(final JPAEdmSchemaView view) {
  super(view);
  schemaView = view;
  entityTypeView = schemaView.getJPAEdmEntityContainerView()
      .getJPAEdmEntitySetView().getJPAEdmEntityTypeView();
  complexTypeView = schemaView.getJPAEdmComplexTypeView();
  navigationPropertyView = new JPAEdmNavigationProperty(schemaView);
  isBuildModeComplexType = false;
  associationCount = new HashMap<String, Integer>();
}
 
Example #7
Source File: BenefitsJPAEdmExtension.java    From cloud-sfsf-benefits-ext with Apache License 2.0 4 votes vote down vote up
@Override
public void extendJPAEdmSchema(final JPAEdmSchemaView view) {
	Schema edmSchema = view.getEdmSchema();
	edmSchema.setComplexTypes(ComplexTypesDescriber.getInstance().getEdmComplexTypes());
}
 
Example #8
Source File: JPAEdmExtension.java    From lemonaid with MIT License 4 votes vote down vote up
@Override
public void extendWithOperation(JPAEdmSchemaView view) {
}
 
Example #9
Source File: BenefitsJPAEdmExtension.java    From cloud-sfsf-benefits-ext with Apache License 2.0 4 votes vote down vote up
@Override
public void extendWithOperation(final JPAEdmSchemaView view) {
	for (Class<?> service : SERVICES) {
		view.registerOperations(service, null);
	}
}
 
Example #10
Source File: SalesOrderProcessingExtension.java    From olingo-odata2 with Apache License 2.0 4 votes vote down vote up
@Override
public void extendWithOperation(final JPAEdmSchemaView view) {
  view.registerOperations(SalesOrderHeaderProcessor.class, null);
  view.registerOperations(CustomerImageProcessor.class, null);

}
 
Example #11
Source File: SalesOrderProcessingExtension.java    From olingo-odata2 with Apache License 2.0 4 votes vote down vote up
@Override
public void extendJPAEdmSchema(final JPAEdmSchemaView view) {
  Schema edmSchema = view.getEdmSchema();
  edmSchema.getComplexTypes().add(getComplexType());
}
 
Example #12
Source File: JPAEdmTestModelView.java    From olingo-odata2 with Apache License 2.0 4 votes vote down vote up
@Override
public JPAEdmSchemaView getEdmSchemaView() {
  return null;
}
 
Example #13
Source File: JPAEdmNameBuilder.java    From olingo-odata2 with Apache License 2.0 4 votes vote down vote up
public static void build(final JPAEdmSchemaView view) throws ODataJPAModelException {
  view.getEdmSchema().setNamespace(buildNamespace(view));
}
 
Example #14
Source File: JPAEdmNavigationProperty.java    From olingo-odata2 with Apache License 2.0 4 votes vote down vote up
public JPAEdmNavigationProperty(final JPAEdmSchemaView schemaView) {
  super(schemaView);
  consistentNavigationProperties = new ArrayList<NavigationProperty>();

}
 
Example #15
Source File: JPAEdmEntityType.java    From olingo-odata2 with Apache License 2.0 4 votes vote down vote up
public JPAEdmEntityType(final JPAEdmSchemaView view) {
  super(view);
  schemaView = view;
  consistentEntityTypeMap = new HashMap<String, EntityType>();
}
 
Example #16
Source File: JPAEdmAssociationSet.java    From olingo-odata2 with Apache License 2.0 4 votes vote down vote up
public JPAEdmAssociationSet(final JPAEdmSchemaView view) {
  super(view);
  schemaView = view;
}
 
Example #17
Source File: JPAEdmModel.java    From olingo-odata2 with Apache License 2.0 4 votes vote down vote up
@Override
public JPAEdmSchemaView getEdmSchemaView() {
  return schemaView;
}
 
Example #18
Source File: JPAEdmEntityContainer.java    From olingo-odata2 with Apache License 2.0 4 votes vote down vote up
public JPAEdmEntityContainer(final JPAEdmSchemaView view) {
  super(view);
  schemaView = view;
}
 
Example #19
Source File: JPAEdmEntitySet.java    From olingo-odata2 with Apache License 2.0 4 votes vote down vote up
public JPAEdmEntitySet(final JPAEdmSchemaView view) {
  super(view);
  schemaView = view;
}
 
Example #20
Source File: JPAEdmAssociation.java    From olingo-odata2 with Apache License 2.0 4 votes vote down vote up
public JPAEdmAssociation(final JPAEdmSchemaView view) {
  super(view);
  init();
}
 
Example #21
Source File: JPAEdmFunctionImport.java    From olingo-odata2 with Apache License 2.0 4 votes vote down vote up
public JPAEdmFunctionImport(final JPAEdmSchemaView view) {
  super(view);
  schemaView = view;
}
 
Example #22
Source File: JPAEdmExtension.java    From odata-boilerplate with MIT License 4 votes vote down vote up
@Override
public void extendWithOperation(JPAEdmSchemaView view) {
}
 
Example #23
Source File: EspmProcessingExtension.java    From cloud-espm-v2 with Apache License 2.0 2 votes vote down vote up
@Override
public void extendJPAEdmSchema(JPAEdmSchemaView arg0) {

}