jOOQ 3.2.0 发布,Java 的 ORM 框架

oschina
 oschina
发布于 2013年10月11日
收藏 18

jOOQ 3.2.0 发布了,该版本主要是将许可证改为 Apache 2.0 许可和商业订阅双许可。此外还包含大量的改进:

#674 Add <fluentSetters/> code generation flag to let generated setters return this
#996 Add support for various Postgres ARRAY operations
#1079 Add support for Oracle's FLASHBACK QUERY clause
#1171 Add a MatcherStrategy GeneratorStrategy to allow for configurative regex pattern matching and replacement
#1644 Add DSL.dual() to explicitly create a DUAL table that works with any dialect
#1903 Duplicate Query construction API between DSLContext and DSL
#2010 Add listener API to Record / UpdatableRecord
#2352 Enhance <ForcedType/> to allow for forcing a type upon all columns / parameters / attributes of a given data type
#2542 Add a Keyword type and DSL.keyword(String) to construct it
#2593 Add Meta.getPrimaryKeys()
#2594 Add primary key and foreign key navigation support in JDBCDatabase
#2595 Add implicit conversions from Scala functions to RecordMapper
#2603 Add <includeExcludeColumns/> flag to code generation configuration to indicate that <includes/> and <excludes/> shall also match column names
#2606 Distinguish ORACLE10G, ORACLE11G, ORACLE12C SQLDialects within the ORACLE family
#2618 Document the fact that different packages are generated for different schemas
#2619 Add an example ExecuteListener to the manual, showing how UPDATE and DELETE statements without WHERE clause can be aborted
#2630 Add DSL.queryPart(String, Object...) and similar methods to create simple plain SQL query parts
#2652 Change tutorial to use the common AUTHOR table, instead of POSTS
#2660 Add some documentation about jOOQ not supporting operator precedence
#2665 Implement SPI for RenderContext listening to allow for custom SQL transformation
#2666 Pull up RenderContext.sql(QueryPart) and BindContext.bind(QueryPart) to Context.visit(QueryPart)
#2667 Add org.jooq.Clause and let org.jooq.Context listen on start(Clause) and end(Clause) events
#2676 Add QueryPartInternal.clause() to allow for QueryParts to return Clause information to org.jooq.Context
#2689 Expose a DAO's internal RecordMapper through DAO.mapper()
#2696 Provide default implementation for CustomQueryPart.bind() (for all Custom QueryParts)
#2699 Generate DEFAULT and NULL metadata information on generated DataTypes
#2701 Document the fact that jOOQ sets changed flags to true, even if Record.setValue() sets the value already present in the record
#2702 Add DataType.defaulted() and DataType.nullable()
#2706 Generate "full" constructors in records, allowing to construct a record with all values set
#2713 Add support for custom code sections in generated code
#2722 Add DSLContext.newRecord(Field<?>...) to support the creation of custom record types
#2723 Add example VisitListener implementation that prevents UPDATE, DELETE statement execution without explicit WHERE clause
#2724 The default logger should log the number of affected records, if applicable
#2725 Add ExecuteContext.rows() to indicate the number of affected rows in the last executed statement
#2726 Add Attachable.detach()
#2729 Emulate IS DISTINCT FROM through IS / IS NOT in SQLite
#2733 Add the default log4j.xml configuration file to the maven plugin
#2745 Generate default constructor and "assignment-constructor" in POJOs
#2757 Add support for DB2 10.5

 

jOOQ 高效的合并了复杂SQL、类型安全、源码生成、Active Records、存储过程以及高级数据类型的 Java 类库。

示例代码:

// Create a new record and insert it into the database
TBookRecord book = create.newRecord(T_BOOK);
book.setTitle("My first book");
book.store();

// Update it with new values
book.setPublishedIn(2010);
book.store();

// Delete it
book.delete();
本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处,尊重他人劳动共创开源社区。
转载请注明:文章转载自 OSCHINA 社区 [http://www.oschina.net]
本文标题:jOOQ 3.2.0 发布,Java 的 ORM 框架
加载中

最新评论(11

苏显斌的博客

引用来自“kukaqin”的评论

现在orm的框架太都了, 做互联网开发,都会有效率问题,所以悲剧的是这么多orm框架,居然还要自己写dao层才能更好的优化缓存

你可以拥抱JPA规范,然后试试Spring Data JPA这个框架,DAO基本不用写了。
沙发迪
沙发迪

引用来自“searchjack”的评论

create.select(AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME, count())
.from(AUTHOR)
.join(BOOK).on(AUTHOR.ID.equal(BOOK.AUTHOR_ID))
.where(BOOK.LANGUAGE.eq("ilnk.org"))
.and(BOOK.PUBLISHED.gt(date("2008-01-01")))
.groupBy(AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME)
.having(count().gt(5))
.orderBy(AUTHOR.LAST_NAME.asc().nullsFirst())
.limit(2)
.offset(1)
.forUpdate()
.of(AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME)

虽然这样看上去挻麻烦的, 不过是个不错的尝试

我还是去写SQL吧!
t
teleport
像是写SQL,我喜欢。
PanDongDong
PanDongDong
还是回归jdbc咯!!!
小白小霸王
小白小霸王

引用来自“kukaqin”的评论

引用来自“小白小霸王”的评论

引用来自“kukaqin”的评论

现在orm的框架太都了, 做互联网开发,都会有效率问题,所以悲剧的是这么多orm框架,居然还要自己写dao层才能更好的优化缓存

我没看明白你要表达什么意思

我想说的是,在大访问量的互联网应用,hibernate,mybatis,这些orm一个都没法用,效率太低

是,我们本来也用hibernate,后来还是用的jdbc
kukaqin
kukaqin

引用来自“小白小霸王”的评论

引用来自“kukaqin”的评论

现在orm的框架太都了, 做互联网开发,都会有效率问题,所以悲剧的是这么多orm框架,居然还要自己写dao层才能更好的优化缓存

我没看明白你要表达什么意思

我想说的是,在大访问量的互联网应用,hibernate,mybatis,这些orm一个都没法用,效率太低
AntMaster
AntMaster
这玩意,居然还活着。
sjack
sjack
create.select(AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME, count())
.from(AUTHOR)
.join(BOOK).on(AUTHOR.ID.equal(BOOK.AUTHOR_ID))
.where(BOOK.LANGUAGE.eq("ilnk.org"))
.and(BOOK.PUBLISHED.gt(date("2008-01-01")))
.groupBy(AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME)
.having(count().gt(5))
.orderBy(AUTHOR.LAST_NAME.asc().nullsFirst())
.limit(2)
.offset(1)
.forUpdate()
.of(AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME)

虽然这样看上去挻麻烦的, 不过是个不错的尝试
小白小霸王
小白小霸王

引用来自“kukaqin”的评论

现在orm的框架太都了, 做互联网开发,都会有效率问题,所以悲剧的是这么多orm框架,居然还要自己写dao层才能更好的优化缓存

我没看明白你要表达什么意思
kukaqin
kukaqin
现在orm的框架太都了, 做互联网开发,都会有效率问题,所以悲剧的是这么多orm框架,居然还要自己写dao层才能更好的优化缓存
返回顶部
顶部