1

Do someone know if there exists a framework for java where I don't have to implement the DAO but I need just to define the interface and it works like the groovy entities?

For example naming a method findByPrimaryKey it will autodetect the primary key and do the right thing.

I'm not sure but I remember I have seen something like this with Spring...Am I wrong?

3
  • Have you considered JPA (Java Persistence API)? Commented Jan 25, 2012 at 11:00
  • Take a look at ormlite.com Commented Jan 25, 2012 at 11:05
  • I've used the JPA, but I remember I had to write the DAOs using it...I'm looking for something which I need just to create an interface and it will be create at runtime maybe with a proxy... Commented Jan 25, 2012 at 11:06

5 Answers 5

4

You may want to take a look at the Spring Data-JPA project . It has similar features to what you need . See their page here.

Here's a link to their query methods . It think this is what you're looking for .

Sign up to request clarification or add additional context in comments.

Comments

2

There are two for Spring, both based on JPA

2 Comments

YEAH! it was spring data JPA...I don't know hades...I will take a look...do you know it? how is it?
I used Hades very often and I like it, but Spring-Data-JPA is its successor (Oliver Gierke how has written Hades, works now for Spring and write Spring-Data-JPA). I will switch to Spring-Data-JPA for new projects
0

sormula may work for you also. CRUD operations are available without requiring any DAO implementions. It does not have auto primary key detection but one simple annotation defines the primary key(s).

Comments

0

As of Grails 2.3.6, GORM is officially supported as a standalone module. See the release notes for more details.

Comments

0

you might want to consider ActiveJDBC: http://javalite.io/activejdbc. It was modeled after RoR ActiveRecord, and retains some of its dynamic behavior. However, in Java you cannot define new methods at run time, as there is no equivalent of method_mising from Ruby. There is plenty documentation you can follow: http://javalite.io/documentation

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.