Is there any ActiveRecord implementation for java?

M

maheshexp

I was wondering is there any existing ActiveRecord implemented for the
mammoth programming language? With the Rails, ActiveRecord been made
famous than any other implementation and why not for java?
 
A

Arved Sandstrom

maheshexp said:
I was wondering is there any existing ActiveRecord implemented for the
mammoth programming language? With the Rails, ActiveRecord been made
famous than any other implementation and why not for java?

ActiveObjects (https://activeobjects.dev.java.net/) is one example. I
don't know how active (excuse the pun) this implementation is.

AHS
 
M

markspace

maheshexp said:
I was wondering is there any existing ActiveRecord implemented for the
mammoth programming language? With the Rails, ActiveRecord been made
famous than any other implementation and why not for java?


I don't know much about ActiveRecord or Hibernate, but just reading the
descriptions, I think that Hibernate may be Java's answer to ActiveRecord.

<https://www.hibernate.org/>
 
D

Daniel Pitts

markspace said:
I don't know much about ActiveRecord or Hibernate, but just reading the
descriptions, I think that Hibernate may be Java's answer to ActiveRecord.

<https://www.hibernate.org/>
I've used hibernate extensively. If you're doing simple mappings, it is
great, but once you start getting more complicated, or need to do custom
logic, it starts getting annoying.
 
A

Arved Sandstrom

markspace said:
I don't know much about ActiveRecord or Hibernate, but just reading the
descriptions, I think that Hibernate may be Java's answer to ActiveRecord.

<https://www.hibernate.org/>
Depends on what you mean by answer. JPA implementations like EclipseLink
JPA and Hibernate JPA follow the Data Mapper pattern. Persistence
operations are not handled by the domain objects but rather by another
thing (or things), like the EntityManager. Whereas in the active record
pattern the domain objects themselves are responsible for persistence
operations.

AHS
 
L

Lew

Daniel said:
I've used hibernate extensively. If you're doing simple mappings, it is
great, but once you start getting more complicated, or need to do custom
logic, it starts getting annoying.

I use Hibernate, and more generally JPA, extensively. Some of my uses are
complicated. It's never been any more annoying than complicated programming
is regardless. In fact, Hibernate's rather useful and powerful when things
get complicated. (I prefer to use it in JPA-compliant mode.)

Some of my colleagues have run into trouble using ORM (object-relational
mapping) as a data-access layer rather than as a foundation for an object
model. Hibernate isn't SQL.
 
M

maheshexp

ActiveObjects (https://activeobjects.dev.java.net/) is one example. I
don't know how active (excuse the pun) this implementation is.

AHS

Even I had a look at it few days back, but still it couldnt give me a
simple API like ruby. But still some complex design patterns are
followed to complicate things on the basis of OO. Like
Person[] drinkers = manager.find(Person.class, Query.select().where
("age > ?", 21).limit(10));

rather than
Person.find().where( "age > $1", Object[]{ 21}).limit(10)

Person.store()

Person.delete().where( "id = 100")
 
M

maheshexp

I've used hibernate extensively.  If you're doing simple mappings, it is
great, but once you start getting more complicated, or need to do custom
logic, it starts getting annoying.

Yes, Hibernate complicates simple things in a Complex environment.
Eg: To invoke a simple stored proc, why do I need to create a Named
query and configure the StoredProc params in Hibernate? Doesn't it
look like doing some redundant work?
 
M

maheshexp

Depends on what you mean by answer. JPA implementations like EclipseLink
JPA and Hibernate JPA follow the Data Mapper pattern. Persistence
operations are not handled by the domain objects but rather by another
thing (or things), like the EntityManager. Whereas in the active record
pattern the domain objects themselves are responsible for persistence
operations.

AHS

Well said. Most of the JPA implementations have EntityManger, which
takes care of doing all the operations (CRUD), like the one example
I've quoted in the previous post on Java implementation of
ActiveObjects.

But Rails, has told us a different story. I'm not portraying rails as
a great web arch here, but atleast it showed a way on how somethings
could be done simpler, rather following dumb(sometimes) design
patterns.
 
D

Daniel Pitts

Lew said:
I use Hibernate, and more generally JPA, extensively. Some of my uses
are complicated. It's never been any more annoying than complicated
programming is regardless. In fact, Hibernate's rather useful and
powerful when things get complicated. (I prefer to use it in
JPA-compliant mode.)

Some of my colleagues have run into trouble using ORM (object-relational
mapping) as a data-access layer rather than as a foundation for an
object model. Hibernate isn't SQL.
I've had issues using Embedded's in collections which have one-to-many
for entities or other embeddeds. If you have a tree-like structure, you
end up with some artificial constraints from Hibernate.

Also, Hibernate's "Criteria" object tends to handle certain types of
joins in non-intuitive ways.

Like I said, its great for some cases, but for my usages I tend to find
a lot of broken edge cases.
 
T

Tom Anderson

I've used hibernate extensively. If you're doing simple mappings, it is
great, but once you start getting more complicated, or need to do custom
logic, it starts getting annoying.

What kind of more complucated, and what kind of custom logic? I haven't
used Hibernate/JPA, but want to start, so i'm interested in this sort of
stuff.

A colleague said something similar, FWIW - great for simple cases, but
struggling on more complex stuff. His example involved manipulate a
many-many relationship on a set of detached objects - when he reattached
them, Hibernate went mad.

tom
 
A

Arne Vajhøj

I've used hibernate extensively. If you're doing simple mappings, it is
great, but once you start getting more complicated, or need to do custom
logic, it starts getting annoying.

My experience is that:
- if you start with Hibernate and create the database for
Hibernate, then it works great
- if the database is an existing database created for
other usage, then using Hibernate to access it can
become very painful

Arne
 
Joined
Feb 8, 2010
Messages
2
Reaction score
0
ActiveRecord coming to Java

I have been working on ActiveRecord-like implementation in Java (ActiveJDBC). IMHO, it is about 60% complete. You can have some idea looking at my blog here: http: igorpolevoy.blogspot.com

have fun,
igor
 
Joined
Feb 8, 2010
Messages
2
Reaction score
0
ActiveJDBC == ActiveRecord in Java

I released a project called ActiveJDBC, which is implementation of ActiveRecord in Java. You can get details of the project here:
http : //code.google.com/p/activejdbc/
Enjoy.

igor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top