Thanks!
now OJB 1.0.rc5 works fine
it makes me now PKs automaticly
thanks
but it doesn�t deal with
foreignkey
customer --> car
i do
cu = new Customer();
cu.setName("foo");
car = new Car();
car.setColor("blue");
cu.setCar(car);
...
broker.store(cu);
okay
in DB is a new car and a new customer.
but carId in table customer is ="0".
(car has a new PK become by db)
in xml i did this in customer-describtion:
<reference-descriptor
name="car"
class-ref="de.ralle.Car"
auto-retrieve="true"
auto-update="true"
auto-delete="true">
<foreignkey field-ref="carId"/>
</reference-descriptor>
in class Customer
i have this:
Car car;
int carId;
any idea?
i watched docu,in internet, saw tutorial3
but it is not deliverd with OJB.
so please not be angry (because of lots questions)
(i last worked with 0.94... sorry)
Thanks advice!
Ralf
--- Brian McCallister
<[EMAIL PROTECTED]> schrieb: > Your
primary key should be one of the primitive
> wrappers, ie Integer
> instead of int.
>
> If you use an int then it is initialized to 0, which
> is saved into the
> database as it is a valid int =( If you want
> autoincrement to work you
> need to use the Integer (or Long) wrapper. When the
> pk is null, it will
> autoincrement.
>
>
> public class IncorrectThing
> {
> public int pk;
> }
>
> public class CorrentThing
> {
> public Integer pk;
> }
>
> IncorrectThing it = new IncorrectThing();
> CorrectThing ct = new CorrectThing();
>
> If "it" is stored it has a valid value for it.pk -->
> 0
> If "ct" is stored it has null for ct.pk, so will
> have a value assigned.
>
> -Brian
>
> On Feb 2, 2004, at 11:47 AM, Ralf Bode wrote:
>
> > 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
>
=== message truncated ===
__________________________________________________________________
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]