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


Java ODataJPAContext.setPersistenceUnitName方法代码示例

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


在下文中一共展示了ODataJPAContext.setPersistenceUnitName方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: initializeODataJPAContext

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入方法依赖的package包/类
@Override
public ODataJPAContext initializeODataJPAContext()
    throws ODataJPARuntimeException {
  ODataJPAContext oDataJPAContext = getODataJPAContext();
  oDataJPAContext.setEntityManagerFactory(JPAEntityManagerFactory.getEntityManagerFactory(PUNIT_NAME));
  oDataJPAContext.setPersistenceUnitName(PUNIT_NAME);
  oDataJPAContext.setJPAEdmMappingModel(MAPPING_MODEL);
  oDataJPAContext.setJPAEdmExtension(new SalesOrderProcessingExtension());
  oDataJPAContext.setPageSize(PAGE_SIZE);
  oDataJPAContext.setDefaultNaming(false);
  oDataJPAContext.getODataContext().setDebugMode(true);
  setErrorLevel();
  setOnWriteJPAContent(onDBWriteContent);
  return oDataJPAContext;
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:16,代码来源:JPAReferenceServiceFactory.java

示例7: initializeODataJPAContext

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入方法依赖的package包/类
@Override
public ODataJPAContext initializeODataJPAContext()
		throws ODataJPARuntimeException {
	ODataJPAContext oDataJPAContext = getODataJPAContext();
	EmfHolder emfHolder = EmfHolder.createInstance();
	oDataJPAContext.setEntityManagerFactory(emfHolder.getEntityManagerFactory());
	oDataJPAContext.setPersistenceUnitName(emfHolder.getPersistenceUnitName());

	oDataJPAContext.setPageSize(PAGE_SIZE);
	setDetailErrors(true);

	return oDataJPAContext;
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:14,代码来源:ODataJPACarServiceFactory.java

示例8: initializeODataJPAContext

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入方法依赖的package包/类
@Override
public ODataJPAContext initializeODataJPAContext()
		throws ODataJPARuntimeException {
	  ODataJPAContext oDataJPAContext = this.getODataJPAContext();  
        try {  
            EntityManagerFactory emf = Persistence  
                    .createEntityManagerFactory(persistenceUnitName);
            oDataJPAContext.setEntityManagerFactory(emf);
            oDataJPAContext.setPersistenceUnitName(persistenceUnitName);  
            return oDataJPAContext;  
        } catch (Exception e) {  
            throw new RuntimeException(e);  
        }  
}
 
开发者ID:msopentechcn,项目名称:odata-producer-codegen-for-jdbc,代码行数:15,代码来源:OdataJPAServiceFactory.java

示例9: 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:SAP,项目名称:cloud-personslist-scenario,代码行数:15,代码来源:PersonsListServiceFactory.java

示例10: initializeODataJPAContext

import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext; //导入方法依赖的package包/类
@Override
public ODataJPAContext initializeODataJPAContext() throws ODataJPARuntimeException {
	ODataJPAContext oDataJPAContext = this.getODataJPAContext();
	try {
		oDataJPAContext.setEntityManagerFactory(EntityManagerFactoryProvider.getInstance().getEntityManagerFactory());
		oDataJPAContext.setPersistenceUnitName(PERSISTENCE_UNIT_NAME);
		oDataJPAContext.setJPAEdmExtension(new BenefitsJPAEdmExtension());

		setContextInThreadLocal(oDataJPAContext.getODataContext());
		return oDataJPAContext;
	} catch (Exception e) {
		throw new ODataRuntimeException("Cannot initialize OData JPA Context", e); //$NON-NLS-1$
	}

}
 
开发者ID:SAP,项目名称:cloud-sfsf-benefits-ext,代码行数:16,代码来源:BenefitsODataServiceFactory.java

示例11: initializeODataJPAContext

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

		
	 
  ODataJPAContext oDatJPAContext = this.getODataJPAContext();
  try {
	 
    EntityManagerFactory emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
    
    Utility.setEntityManagerFactory( emf );
    
    // Load seed data
    if (first_invocation) {
  	  	DataLoader m = new DataLoader( 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");
    
    OChatProcessingExtension ext = new OChatProcessingExtension();
    oDatJPAContext.setJPAEdmExtension(ext);
    
    setDetailErrors(true);
    
    //setErrorLevel();
    
    return oDatJPAContext;
	 
  } catch (Exception e) {
  	e.printStackTrace();
  	throw new RuntimeException(e);
  }
	 
}
 
开发者ID:SAP,项目名称:cloud-olingo-identity-ochat,代码行数:42,代码来源:OChatServiceFactory.java


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