Mapping Database Tables to Objects

Discussion in 'Java' started by spivee@excite.com, Jan 26, 2005.

  1. Guest

    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.
     
    , Jan 26, 2005
    #1
    1. Advertising

  2. Frank Guest

    wrote:
    > 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/>
     
    Frank, Jan 26, 2005
    #2
    1. Advertising

  3. In article <>,
    wrote:

    > 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
     
    Scott Ellsworth, Jan 26, 2005
    #3
  4. Guest

    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.
     
    , Jan 26, 2005
    #4
  5. Bryce Guest

    On 26 Jan 2005 06:12:16 -0800, wrote:

    >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/

    --
    now with more cowbell
     
    Bryce, Jan 27, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hilz
    Replies:
    9
    Views:
    3,180
    P.Hill
    Jul 27, 2004
  2. Mike
    Replies:
    0
    Views:
    465
  3. Chris Brat
    Replies:
    5
    Views:
    709
    =?iso-8859-1?q?Luis_M._Gonz=E1lez?=
    Aug 22, 2006
  4. big vinny
    Replies:
    2
    Views:
    297
    big vinny
    Oct 11, 2005
  5. ThomasW
    Replies:
    11
    Views:
    294
    ThomasW
    Sep 28, 2009
Loading...

Share This Page