[Logo] JavaRanch » Big Moose Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Object Relational Mapping
 
RSS feed
 
New topic
Author

What ORM Frameworks Support Constructor Injection?

David Sledge
Greenhorn

Joined: Jun 29, 2009
Messages: 3

What ORM frameworks support constructor injection? I've looked at Hibernate and iBatis, and I don't see where either (currently) support constructor injection. (It looks like iBatis will support down the road, but I'm looking for something in the here and now.)

Thanks,

D

This message was edited 1 time. Last update was at by David Sledge

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Messages: 14896

Explain what you mean by constructor injection? And also why you would need such a feature in relation to ORMs and domain objects?

Thanks

Mark

Perfect World Programming, LLC
Spock's Beard - Foabia app - Money Mgt Calculator - Paper Clips
How to Ask Questions the Smart Way FAQ
David Sledge
Greenhorn

Joined: Jun 29, 2009
Messages: 3

Constructor injection: Using a class's constructor to set one or more of its dependencies instead of using a setter method.

It's useful when mapped objects are immutable, when you want to require that a specific member always be set (i.e. not null) right from the object's instantiation, or are using classes that lack a no-argument one.

My specific issue is in line with the last reason. I have a stored procedure, and I want to map the results to a list of data objects whose class does not have a no-argument constructor.
David Sledge
Greenhorn

Joined: Jun 29, 2009
Messages: 3

Answer: iBATIS 3 for Java (beta). Released a couple of weeks ago.

This message was edited 1 time. Last update was at by David Sledge

 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Object Relational Mapping
 
RSS feed
 
New topic
IntelliJ open source

.