This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Object Relational Mapping and the fly likes How to build all POJOs in one action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How to build all POJOs in one action" Watch "How to build all POJOs in one action" New topic
Author

How to build all POJOs in one action

Fandy Akhmad
Ranch Hand

Joined: Nov 26, 2011
Posts: 32

Dear Javaranch..

I have 5 POJOs and i want to build them in one execution.
What tool must i have?

Thanks
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
All you need is a Java compiler and programming skill.
Fandy Akhmad
Ranch Hand

Joined: Nov 26, 2011
Posts: 32

I mean that 5 POJOs is automatically build and become a tables in database.
May be need some tool for build that POJOs
Jayr Motta
Ranch Hand

Joined: Jul 30, 2010
Posts: 110

The question is: what you meant with "action"?

Is this a struts action? If so, which struts feature are you using (or any other library you're using) to serialize objects in requests and responses?

If you're going to take your application to this level, I would advise you move to other framework: http://vraptor.caelum.com.br/ with @Consumes( "application/json"). But if you have a lot of code already written using struts, try to find something that allow you serialize JSON objects into the action context and you'll be able to get them already serialized. Something like this http://code.google.com/p/jsonplugin/.

Anyway, consider frameworks like these: VRaptor, RESTEasy, etc, they are more evolved in the "Java web development way of thinking," nothing against Struts but I've been seeing extremely good changes while using http-based technologies! REST with some powerful IoC container behind.

I hope this helps!


Feel free to ask me anything!
www.BlackBeltFactory.com/ui#!/ref=jmotta, SCJP 6, OCWCD JEE5, OCE EJB JEE6
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3826

Fandy Akhmad wrote:I mean that 5 POJOs is automatically build and become a tables in database.

You need to automate the schema creation? And you may need to provide clear information about what you are trying to accomplish. Please read TellTheDetails.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Jayr Motta
Ranch Hand

Joined: Jul 30, 2010
Posts: 110

For DDL automatic generation you may use JPA annotations and some persistence provider with this feature enabled.
Fandy Akhmad
Ranch Hand

Joined: Nov 26, 2011
Posts: 32

Sorry for my unclear post.

I want to generate table use Apache Ant. I know it must use build.xml file.
How the structure of build.xml file?
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3826

Fandy Akhmad wrote:...How the structure of build.xml file?

I suggest you start with the simple Ant guide provided in the manual itself here.
Fandy Akhmad
Ranch Hand

Joined: Nov 26, 2011
Posts: 32

Thanks for your suggestion.
 
wood burning stoves
 
subject: How to build all POJOs in one action