Very interesting project - what next?

0 views
Skip to first unread message

Petr Jiricka

unread,
Dec 22, 2009, 4:33:05 PM12/22/09
to Arid POJOs
Hi,

I just stumbled upon Arid POJOs, and I must say I don't understand why
I never heard about it in the last 2.5 years (and that I am writing
the first message on this forum). GORM dynamic finders are a great
idea, and I thought everyone would love to see something like that in
Java. I thought by now, everyone should be using it.

That said, Arid POJOs is now 2.5 years old, and I think it would be
useful to bring it up to date with the latest technologies and
development approaches. In particular, Java Persistence 2.0 now has
the vast majority of Hibernate features (and Hibernate will be JPA 2
compliant soon), so it would be useful to be able to use Arid POJOs
with JPA.
Next, I think the configuration code could be further simplified/
eliminated via annotations. For example, I can imagine that with
Lombok (http://projectlombok.org/), it would be feasible to just write
the following:

@Finders(resultClass=Account.class, finders={"findByAccountId",
"findByBalanceGreaterThan", "findByBalanceBetween"})
public class AccountRepository implements GenericDao<Account, Integer>
{
}

With things like this now possible:
@javax.persistence.PersistenceContext private EntityManager em;
Lombok could generate the appropriate finders including
implementations (using JPA 2 criteria API), it would automatically
figure out the arguments and return types for the finder methods etc.
There would be no XML at all, just the simple @Finders annotation.

So, I am looking at Arid POJOs, and thinking it would be worthwhile to
bring it up to date with the latest specifications such as JPA 2, JSR
299/330, EJB 3.1, and take advantages of innovative approaches such as
Lombok.

(BTW, I also looked at the Spring Roo project, which effectively
implements dynamic finders, but I must say one thing I don't like
about Roo is that the finder implementation still lives in your source
(in an auto-generated aspect). It should be hidden in a library/
framework, not in my source.)

What do you think?

Chris Richardson

unread,
Jan 4, 2010, 11:53:01 AM1/4/10
to arid-...@googlegroups.com
Petr,

Glad you like Arid POJOs.
I've been using it for quite a while on various real world projects.
The idea of extending Arid POJOs to support both Hibernate and JPA 2.0 is definitely appealing.
(I tend to use raw Hibernate still)

Are you interested in doing the work?

I'll look at Lombok.

Chris




--

You received this message because you are subscribed to the Google Groups "Arid POJOs" group.
To post to this group, send email to arid-...@googlegroups.com.
To unsubscribe from this group, send email to arid-pojos+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/arid-pojos?hl=en.



Petr Jiricka

unread,
Jan 5, 2010, 10:40:24 AM1/5/10
to arid-...@googlegroups.com
On Mon, Jan 4, 2010 at 5:53 PM, Chris Richardson <ch...@chrisrichardson.net> wrote:

Are you interested in doing the work?

Sure, I will start looking into that. I am still only learning JPA 2.0, but it does not look that different from the Hibernate API.
BTW, one thing I saw in the source code is that the "or" operator does not seem to be implemented, right? Is it because one would need to consider operator precedence and the implementation would get more complex?
 

I'll look at Lombok.

There is a discussion at the Lombok Google group about the possible application of Lombok in the DAO area:
http://groups.google.com/group/project-lombok/browse_thread/thread/a8c01b2226c081cb
 
I'd like to know your opinion about this direction.

Petr


Chris


Reply all
Reply to author
Forward
0 new messages