Prev: servlet/applet communication problem or Linux/Windows trouble?
Next: Better way to implement reverse mapping of custom enum ordinals?
From: Lew on 18 Dec 2009 09:27 arkspace wrote: >> <https://www.hibernate.org/> Daniel Pitts wrote: > 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. -- Lew
From: maheshexp on 18 Dec 2009 12:39 On Dec 18, 7:33 am, Arved Sandstrom <dces...(a)hotmail.com> wrote: > maheshexp wrote: > > 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 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")
From: maheshexp on 18 Dec 2009 12:42 On Dec 18, 1:10 pm, Daniel Pitts <newsgroup.spamfil...(a)virtualinfinity.net> wrote: > markspace wrote: > > maheshexp wrote: > >> 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/> > > 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. > > -- > Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/> 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?
From: maheshexp on 18 Dec 2009 12:44 On Dec 18, 6:41 pm, Arved Sandstrom <dces...(a)hotmail.com> wrote: > markspace wrote: > > maheshexp wrote: > >> 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/> > > 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.
From: Daniel Pitts on 18 Dec 2009 17:39
Lew wrote: > arkspace wrote: >>> <https://www.hibernate.org/> > > Daniel Pitts wrote: >> 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. > 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. -- Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/> |