当前位置: 首页>>代码示例>>Java>>正文


Java ODataJPAContext类代码示例

本文整理汇总了Java中org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext的典型用法代码示例。如果您正苦于以下问题:Java ODataJPAContext类的具体用法?Java ODataJPAContext怎么用?Java ODataJPAContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ODataJPAContext类属于org.apache.olingo.odata2.jpa.processor.api包,在下文中一共展示了ODataJPAContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getEntityProviderProperties

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入依赖的package包/类
private static EntityProviderWriteProperties getEntityProviderProperties(final ODataJPAContext odataJPAContext,
    final GetEntityUriInfo resultsView) throws ODataJPARuntimeException {
  ODataEntityProviderPropertiesBuilder entityFeedPropertiesBuilder = null;
  ExpandSelectTreeNode expandSelectTree = null;
  try {
    entityFeedPropertiesBuilder =
        EntityProviderWriteProperties.serviceRoot(odataJPAContext.getODataContext().getPathInfo().getServiceRoot());
    expandSelectTree = UriParser.createExpandSelectTree(resultsView.getSelect(), resultsView.getExpand());
    entityFeedPropertiesBuilder.expandSelectTree(expandSelectTree);
    entityFeedPropertiesBuilder.callbacks(JPAExpandCallBack.getCallbacks(odataJPAContext.getODataContext()
        .getPathInfo().getServiceRoot(), expandSelectTree, resultsView.getExpand()));
  } catch (ODataException e) {
    throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
  }

  return entityFeedPropertiesBuilder.build();
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:18,代码来源:ODataJPAResponseBuilderDefault.java

示例2: initializeODataJPAContext

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入依赖的package包/类
@Override
 public ODataJPAContext initializeODataJPAContext()
         throws ODataJPARuntimeException {
     ODataJPAContext oDataJPAContext = this.getODataJPAContext();
     try {
     	EntityManagerFactory emf = JpaEntityManagerFactory.getEntityManagerFactory();
oDataJPAContext.setEntityManagerFactory(emf);
         oDataJPAContext.setPersistenceUnitName(PERSISTENCE_UNIT_NAME);
         return oDataJPAContext;
     } catch (Exception e) {
         throw new RuntimeException(e);
     }
 }
 
开发者ID:AnujMehta07,项目名称:cloud-employeeslistapp,代码行数:14,代码来源:EmployeesListServiceFactory.java

示例3: initializeODataJPAContext

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入依赖的package包/类
public ODataJPAContext initializeODataJPAContext() throws ODataJPARuntimeException {
	ODataJPAContext oDataJPAContext = getODataJPAContext();

	EntityManagerFactory factory = (EntityManagerFactory) SpringContextsUtil.getBean(ENTITY_MANAGER_FACTORY_ID);

	oDataJPAContext.setEntityManagerFactory(factory);
	oDataJPAContext.setPersistenceUnitName(DEFAULT_ENTITY_UNIT_NAME);
	oDataJPAContext.setJPAEdmExtension(new JPAEdmExtension());
	ODataContextUtil.setODataContext(oDataJPAContext.getODataContext());

	return oDataJPAContext;
}
 
开发者ID:sapmentors,项目名称:lemonaid,代码行数:13,代码来源:JPAServiceFactory.java

示例4: getODataJPAContext

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入依赖的package包/类
/**
 * @return an instance of type {@link ODataJPAContext}
 * @throws ODataJPARuntimeException
 */
public final ODataJPAContext getODataJPAContext() throws ODataJPARuntimeException {
	if (oDataJPAContext == null) {
		oDataJPAContext = ODataJPAFactory.createFactory().getODataJPAAccessFactory().createODataJPAContext();
	}
	if (oDataContext != null) {
		oDataJPAContext.setODataContext(oDataContext);
	}
	return oDataJPAContext;

}
 
开发者ID:sapmentors,项目名称:lemonaid,代码行数:15,代码来源:JPAServiceFactory.java

示例5: initializeODataJPAContext

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入依赖的package包/类
@Override
public ODataJPAContext initializeODataJPAContext() throws ODataJPARuntimeException {
	ODataJPAContext oDataJPAContext = getODataJPAContext();

	EntityManagerFactory factory = (EntityManagerFactory) SpringContextsUtil.getBean(ENTITY_MANAGER_FACTORY_ID);

	oDataJPAContext.setEntityManagerFactory(factory);
	oDataJPAContext.setPersistenceUnitName(DEFAULT_ENTITY_UNIT_NAME);
	oDataJPAContext.setJPAEdmExtension(new JPAEdmExtension());
	ODataContextUtil.setODataContext(oDataJPAContext.getODataContext());
	
	return oDataJPAContext;
}
 
开发者ID:jpenninkhof,项目名称:odata-boilerplate,代码行数:14,代码来源:JPAServiceFactory.java

示例6: initializeODataJPAContext

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入依赖的package包/类
@Override
 public ODataJPAContext initializeODataJPAContext()
     throws ODataJPARuntimeException {
 
//LocalEdmExtensions ext = new LocalEdmExtensions();

   ODataJPAContext oDatJPAContext = this.getODataJPAContext();
   try {

     EntityManagerFactory emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
     
     // Load seed data
     if (first_invocation) {
   	  DataLoader m = new DataLoader( emf );
   	  Utility.setEntityManagerFactory( emf );
   	  m.loadData();
   	  first_invocation = false;
     }
     
     oDatJPAContext.setEntityManagerFactory(emf);
     oDatJPAContext.setPersistenceUnitName(PERSISTENCE_UNIT_NAME);
     
     // This file must be located in the same folder as "WEB-INF" in the WAR archive
     oDatJPAContext.setJPAEdmMappingModel("map-tuning.xml");
     
     //oDatJPAContext.setJPAEdmExtension(ext);
     
     setDetailErrors(true);
     
     //setErrorLevel();
     
     return oDatJPAContext;

   } catch (Exception e) {
   	e.printStackTrace();
   	throw new RuntimeException(e);
   }

 }
 
开发者ID:SAP,项目名称:sap_mobile_platform_espm_olingo_services,代码行数:40,代码来源:ESPMServiceFactory.java

示例7: initializeODataJPAContext

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入依赖的package包/类
@Override
public ODataJPAContext initializeODataJPAContext() throws ODataJPARuntimeException {
	ODataJPAContext context = getODataJPAContext();
	context.setEntityManagerFactory(HerokuEntityManagerFactory.getInstance());
	context.setPersistenceUnitName(HerokuEntityManagerFactory.PUNIT_NAME);
	return context;
}
 
开发者ID:shunjikonishi,项目名称:odata-producer,代码行数:8,代码来源:MyODataJPAServiceFactory.java

示例8: ODataEntityParser

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入依赖的package包/类
public ODataEntityParser(final ODataJPAContext context) {
  this.context = context;
  try {
    serviceRoot = context.getODataContext().getPathInfo().getServiceRoot().toString();
  } catch (ODataException e) {
    serviceRoot = "";
  }
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:9,代码来源:ODataEntityParser.java

示例9: ODataJPAEdmProvider

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入依赖的package包/类
public ODataJPAEdmProvider(final ODataJPAContext oDataJPAContext) {
  if (oDataJPAContext == null) {
    throw new IllegalArgumentException(ODataJPAException.ODATA_JPACTX_NULL);
  }
  entityTypes = new LinkedHashMap<String, EntityType>();
  entityContainerInfos = new LinkedHashMap<String, EntityContainerInfo>();
  complexTypes = new LinkedHashMap<String, ComplexType>();
  associations = new LinkedHashMap<String, Association>();
  functionImports = new LinkedHashMap<String, FunctionImport>();
  jpaEdmModel = ODataJPAFactory.createFactory().getJPAAccessFactory().getJPAEdmModelView(oDataJPAContext);
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:12,代码来源:ODataJPAEdmProvider.java

示例10: getJPAEdmModelView

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入依赖的package包/类
@Override
public JPAEdmModelView getJPAEdmModelView(final ODataJPAContext oDataJPAContext) {
  JPAEdmModelView view = null;

  view = new JPAEdmModel(oDataJPAContext);
  return view;
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:8,代码来源:ODataJPAFactoryImpl.java

示例11: getEntityProviderPropertiesforPost

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入依赖的package包/类
private static EntityProviderWriteProperties getEntityProviderPropertiesforPost(
    final ODataJPAContext odataJPAContext) throws ODataJPARuntimeException {
  ODataEntityProviderPropertiesBuilder entityFeedPropertiesBuilder = null;
  try {
    entityFeedPropertiesBuilder =
        EntityProviderWriteProperties.serviceRoot(odataJPAContext.getODataContext().getPathInfo().getServiceRoot());
  } catch (ODataException e) {
    throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
  }

  return entityFeedPropertiesBuilder.build();
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:13,代码来源:ODataJPAResponseBuilderDefault.java

示例12: JPAEdmBaseViewImpl

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入依赖的package包/类
public JPAEdmBaseViewImpl(final ODataJPAContext context) {
  pUnitName = context.getPersistenceUnitName();
  metaModel = context.getEntityManager().getMetamodel();
  jpaEdmMappingModelAccess =
      ODataJPAFactory.createFactory().getJPAAccessFactory().getJPAEdmMappingModelAccess(context);
  jpaEdmExtension = context.getJPAEdmExtension();
  jpaEdmMappingModelAccess.loadMappingModel();
  skipDefaultNaming = !context.getDefaultNaming();
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:10,代码来源:JPAEdmBaseViewImpl.java

示例13: JPAEntity

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入依赖的package包/类
public JPAEntity(final EdmEntityType oDataEntityType, final EdmEntitySet oDataEntitySet,
    final ODataJPAContext context) {
  this.oDataEntityType = oDataEntityType;
  this.oDataEntitySet = oDataEntitySet;
  oDataJPAContext = context;
  try {
    JPAEdmMapping mapping = (JPAEdmMapping) oDataEntityType.getMapping();
    jpaType = mapping.getJPAType();
  } catch (EdmException e) {
    return;
  }
  jpaEntityParser = new JPAEntityParser();
  onJPAWriteContent = oDataJPAContext.getODataContext().getServiceFactory().getCallback(OnJPAWriteContent.class);
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:15,代码来源:JPAEntity.java

示例14: JPAEdmMappingModelService

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入依赖的package包/类
public JPAEdmMappingModelService(final ODataJPAContext ctx) {
  JPAEdmExtension ext = null;
  mappingModelName = ctx.getJPAEdmMappingModel();
  if (mappingModelName == null) {
    ext = ctx.getJPAEdmExtension();
    if (ext != null) {
      mappingModelStream = ext.getJPAEdmMappingModelStream();
    }
  }

  mappingModelExists = mappingModelName != null || mappingModelStream != null;
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:13,代码来源:JPAEdmMappingModelService.java

示例15: getLocalmockODataJPAContext

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入依赖的package包/类
private ODataJPAContext getLocalmockODataJPAContext() {
  ODataJPAContext odataJPAContext = EasyMock.createMock(ODataJPAContext.class);
  EasyMock.expect(odataJPAContext.getPageSize()).andReturn(0).anyTimes();
  EasyMock.expect(odataJPAContext.getPersistenceUnitName()).andStubReturn("salesorderprocessing");
  EasyMock.expect(odataJPAContext.getEntityManagerFactory()).andStubReturn(mockEntityManagerFactory());
  EasyMock.expect(odataJPAContext.getODataJPATransaction()).andStubReturn(getLocalJpaTransaction());
  EasyMock.expect(odataJPAContext.getODataContext()).andStubReturn(getLocalODataContext());
  odataJPAContext.setODataContext((ODataContext) EasyMock.anyObject());
  EasyMock.expectLastCall().anyTimes();
  EasyMock.expect(odataJPAContext.getEntityManager()).andStubReturn(getLocalEntityManager());
  EasyMock.expect(odataJPAContext.isContainerManaged()).andReturn(false);
  EasyMock.expectLastCall().anyTimes();
  EasyMock.replay(odataJPAContext);
  return odataJPAContext;
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:16,代码来源:ODataJPADefaultProcessorTest.java


注:本文中的org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。