This post originated from an RSS feed registered with Java Buzz
by justin cater.
Original Post: Perform CRUD with Active Records
Feed Title: Java Code Geeks
Feed URL: http://feeds.feedburner.com/JavaCodeGeeks
Feed Description: Java 2 Java Developers Resource Center
In this lesson, we are going to see how to perform CRUD with Active Records. Writing CRUD is boring and repetitive, which is why ORMs like Hibernate have emerged and have been successful at increasing developer productivity. But Hibernate makes a lot of assumptions (and restrictions) about your architecture, when often you really just want to operate on single records from tables.
jOOQ knows “active records”, or also UpdatableRecords, which can be loaded with “special” kinds of SELECT statements, and which then keep track of dirty flags, internally. We will learn how to perform simple active record operations and how to use optimistic locking.