package cn.slimsmart.olingo.test;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext;
import org.apache.olingo.odata2.jpa.processor.api.ODataJPAServiceFactory;
import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
public class UserServiceFactory extends ODataJPAServiceFactory {
private static final String PERSISTENCE_UNIT_NAME = "jpa";
@Override
public ODataJPAContext initializeODataJPAContext() throws ODataJPARuntimeException {
ODataJPAContext oDataJPAContext = this.getODataJPAContext();
try {
EntityManagerFactory emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
oDataJPAContext.setEntityManagerFactory(emf);
oDataJPAContext.setPersistenceUnitName(PERSISTENCE_UNIT_NAME);
return oDataJPAContext;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
olingo实例代码
共25个文件
xml:7个
prefs:4个
java:2个
4星 · 超过85%的资源 需积分: 50 115 下载量 66 浏览量
2015-02-02
21:34:29
上传
评论 1
收藏 12KB RAR 举报
温馨提示
Apache Olingo 是个 Java 库,用来实现 Open Data Protocol (OData)。 Apache Olingo 包括服务客户端和 OData 服务器方面。当前支持 OData 2.0 ,未来会支持 OData 4.0。Apache Olingo 扩展部分支持 JPA 持久性或者注释 bean 类。The Open Data Protocol (OData) 是个 web 协议,为了增强各种网页应用程序之间的数据兼容性,微软公司启动了一项旨在推广网页程序数据库格式标准化的开源数据协议(OData)计划,于此同时,他们还发 布了一款适用于OData协议的开发工具,以方便网页程序开发者们使用。
资源推荐
资源详情
资源评论
收起资源包目录
olingo-test.rar (25个子文件)
olingo-test
.project 1KB
src
test
resources
java
main
webapp
WEB-INF
lib
web.xml 1KB
index.jsp 358B
META-INF
MANIFEST.MF 39B
resources
java
cn
slimsmart
olingo
test
User.java 773B
UserServiceFactory.java 1KB
META-INF
persistence.xml 861B
target
m2e-wtp
web-resources
META-INF
MANIFEST.MF 107B
maven
cn.slimsmart.olingo.test
olingo-test
pom.properties 230B
pom.xml 3KB
classes
cn
slimsmart
olingo
test
User.class 1KB
UserServiceFactory.class 1KB
META-INF
persistence.xml 861B
test-classes
.settings
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.jpt.core.prefs 130B
org.eclipse.wst.common.project.facet.core.xml 346B
org.eclipse.m2e.core.prefs 90B
org.eclipse.jdt.core.prefs 664B
org.eclipse.wst.validation.prefs 50B
org.eclipse.wst.jsdt.ui.superType.name 6B
org.eclipse.wst.common.project.facet.core.prefs.xml 321B
org.eclipse.wst.common.component 674B
.jsdtscope 575B
pom.xml 3KB
.classpath 1KB
共 25 条
- 1
资源评论
- youni8082019-05-18可以运行的
- 朱赤墨黑2018-03-22代码不完整 public ODataJPAContext initializeODataJPAContext() throws ODataJPARuntimeException { ODataJPAContext oDataJPAContext = this.getODataJPAContext(); try { EntityManagerFactory emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME); oDataJP
- dengfeng_dengfeng2019-01-28能用,但请教下怎么处理时间类型的字段,怎么把它改造成springboot实现
slimina
- 粉丝: 421
- 资源: 67
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功