With autoincrement=true you generally need to setup a database-specific
sequence to handle assigning the value. Or alternatively one of the
internal tables provides this functionality. (bringing the thread
full-circle :-) )

http://db.apache.org/ojb/howto-use-db-sequences.html


-----Original Message-----
From: Ralf Bode [mailto:[EMAIL PROTECTED] 
Sent: 02 February 2004 16:47
To: OJB Users List
Subject: Re: Installation of OJB

Thanks

i am still dealing now without its internals ;-)
i didnīt figured it out on page!!
Thanks Brenden,!!!

one short question - then i am
quiet! :-)

why must i set the PK in my code?

customer.setId(123);

i described it in XML
primarykey="true"
autoincrement="true"

but got Errsos, when i dont set up
the PK.

thanks again for a quick ;-)
advice 

ralf

--- "Larry V. Streepy, Jr."
<[EMAIL PROTECTED]> schrieb: > I struggled
with this same problem when learning and
> working with OJB.  
> My final solution was to run the build of OJB and
> then setup my project 
> build to extract the generated SQL (the schema.ddl
> file) and copy it 
> into my build area and use ant sql tasks to generate
> the tables.  I know 
> that this creates a minor dependency between the two
> projects, but 
> that's fairly easy to manage.  I have no need for
> setting up and 
> utilizing torque in my project (I use Axgen to
> generate everything from 
> UML), so it seemed like major complications to solve
> a simple problem.
> 
> YMMV.
> Larry.
> 
> Brian McCallister wrote:
> 
> > I have considered including the torque stuff in
> the ojb-blank project 
> > before, and opted against it as I thought I might
> be pushing too much 
> > complexity on users then.
> >
> > Right now there isn't an *ideal* way to create the
> internal tables as 
> > most of the time people don't need them (though
> the hi/lo sequence 
> > table is needed enough that this may be incorrect,
> since it is the 
> > default sequence manager).
> >
> > What are thoughts on including the torque
> generator stuff in 
> > ojb-blank? The ojb-core schema is already included
> in the src/schema 
> > directory, but the build-torque and torque related
> jars are not 
> > included. Now that I think about it, I have done
> this for all of the 
> > projects I have built around ojb-blank bits
> anyway, so that is a 
> > certain argument in favor.
> >
> > In the short term, Thomas D has has a nice little
> walkthrough on 
> > getting torque from OJB setup in the xdoclet docs,
> but that is sort of 
> > hidden =) (note, we should probably move that into
> its own HOWTO).
> >
> > -Brian
> >
> > On Feb 2, 2004, at 3:19 AM, Ralf Bode wrote:
> >
> >> Hi to all,
> >>
> >> just a question about to install OJB
> >> i read, that i have to load the sources and
> >> run some build-scripts okay.
> >>
> >> but is there an easy-way?
> >> i only need a build-script for the binary-version
> >> of OJB, that "installs" OJB-internal-tables into
> >> database.
> >>
> >> or is there a reason for "building" all ?
> >>
> >> thanks for advice!
> >>
> >> greetings
> >> ralf
> >>
> >>
>
__________________________________________________________________
> >>
> >> Gesendet von Yahoo! Mail - http://mail.yahoo.de
> >> Mit Yahoo! Suche finden Sie alles:
> http://suche.yahoo.de
> >>
> >>
>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> >> For additional commands, e-mail:
> [EMAIL PROTECTED]
> >>
> >>
> >
> >
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>  

__________________________________________________________________

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Mit Yahoo! Suche finden Sie alles: http://suche.yahoo.de

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to