简体   繁体   English

哪种Java数据库API最容易使用?

[英]Which Java database API is easiest to use?

I am coming back to Java from Ruby and ActiveRecord and want to use something as easy as ActiveRecord in Ruby. 我从Ruby和ActiveRecord回到Java,想在Ruby中使用像ActiveRecord一样简单的东西。 What options do I have? 我有什么选择?

有一个同事最近发布了一个名为ActiveJDBC的项目,它是ActiveRecord for Java的一个实现。

It'll probably some sort of Object Relational Mapping framework you end up using. 它可能是你最终使用的某种对象关系映射框架。 Grails (a Java Rails like framework) has GORM: Grails(像框架这样的Java Rails)有GORM:

http://www.grails.org/GORM http://www.grails.org/GORM

If you're not using a web framework like that then it'll prob. 如果你没有使用像这样的网络框架那么它将是可能的。 be some sort of ORM framework - Hibernate, OpenJPA etc... 是某种ORM框架 - Hibernate,OpenJPA等......

http://www.hibernate.org/ http://www.hibernate.org/

If you don't want to do the full heavyweight ORM way then look at something like MyBatis (used to be iBatis) which has SQLMaps: 如果你不想做完整的重量级ORM方式,那么看看像MyBatis(曾经是iBatis)这样的东西有SQLMaps:

http://www.mybatis.org/ http://www.mybatis.org/

Hibernate provides very nice ActiveRecord-like access. Hibernate提供了非常好的类似ActiveRecord的访问。 There are tools to reverse-engineer models from the database. 有一些工具可以从数据库中反向设计模型。 I keep it simple and it works well for me. 我保持简单,对我来说效果很好。

I like JPA myself (Java Persistence API). 我自己喜欢JPA(Java Persistence API)。 Easy to configure and with the right tools you can generate the database from classes or generate the classes from the database. 易于配置,使用正确的工具,您可以从类生成数据库或从数据库生成类。 It's easy to configure your classes with the annotations that you can use. 使用您可以使用的注释配置类很容易。

I use the OpenJPA implementation myself. 我自己使用OpenJPA实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在示例Java项目中使用数据库的最简单方法? - Easiest Way to Use Database in Sample Java Project? 这是使用Java为桌面应用程序提供日历功能的最简单的API - Which is the easiest API for providing calendar feature for desktop application using java 是否有一个Java数据库API,可以从beanshell中单独使用? - Is there a Java database API which I can use exclusively from beanshell? 验证已连接的数据库-Java持久性API - Verifying the database which is connected - Java persistence API 在Java中获取数据库元数据的最简单方法? - Easiest way to obtain database metadata in Java? 最简单的gui工具包,用于学习和使用java - Easiest gui toolkit to learn and use for java 在休眠实体中使用哪种Java数据类型表示数据库中的ID列 - Which java datatype to use in a hibernate entity to represent id colum in a database Java Swing应用程序使用哪个兼容Hibernate的嵌入式数据库? - Which Hibernate compatible embedded database to use for Java Swing application? 读写xml字符串的最简单最简单的java API是什么? - What is the simple and easiest java API to read and write xml strings? 在Java中实现REST API客户端和JSON解析器的最简单方法是什么? - The easiest way to implement REST API client and JSON parser in Java?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM