Mapping Database Tables to Objects

S

spivee

I'm trying to teach myself java and struts. Fairly new at this, so
bear with me...

I'm trying to find out if there's a simpler way to autogenerate a basic
Java Object class file from a database table.

My database contains several tables that represent Business Objects,
such as a user. Generally, my BO tables, I create a corresponding Java
Object that contains a constructor, get() and set() methods for each
column and usually a toString() method. If I've got 20 business object
tables with 10-15 columns each, just creating the BO classes takes
forever.

I'm thinking there's got to be a way to do this easier. Any
suggestions?

Thanks.
 
F

Frank

I'm trying to teach myself java and struts. Fairly new at this, so
bear with me...

I'm trying to find out if there's a simpler way to autogenerate a basic
Java Object class file from a database table.

My database contains several tables that represent Business Objects,
such as a user. Generally, my BO tables, I create a corresponding Java
Object that contains a constructor, get() and set() methods for each
column and usually a toString() method. If I've got 20 business object
tables with 10-15 columns each, just creating the BO classes takes
forever.

I'm thinking there's got to be a way to do this easier. Any
suggestions?

Thanks.

Look into Hibernate. - <http://www.hibernate.org/>
 
S

Scott Ellsworth

I'm trying to teach myself java and struts. Fairly new at this, so
bear with me...

I'm trying to find out if there's a simpler way to autogenerate a basic
Java Object class file from a database table.

Check out Cayenne. They recently added ant support for their
dbgenerator, and have had a nice GUI for it for a while.

Scott
 
S

spivee

Thanks for the advice guys. I had been looking into hibernate because
I'd heard it did what I was asking for, but it does a lot more. It
seems a bit extravagant for what I need, plus, I was just flat having
problems getting it to work.

Looks like I got it now, but like I said, it's a bit much. I'm still
working with pretty simple projects.
I'll take a look at Cayenne too.

Thanks again.
 
B

Bryce

I'm trying to teach myself java and struts. Fairly new at this, so
bear with me...

I'm trying to find out if there's a simpler way to autogenerate a basic
Java Object class file from a database table.

My database contains several tables that represent Business Objects,
such as a user. Generally, my BO tables, I create a corresponding Java
Object that contains a constructor, get() and set() methods for each
column and usually a toString() method. If I've got 20 business object
tables with 10-15 columns each, just creating the BO classes takes
forever.

I'm thinking there's got to be a way to do this easier. Any
suggestions?

http://boss.bekk.no/boss/middlegen/
 

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,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top