@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4



Comments:

<0> smsie: and yes, I like learning from within an existing project, but sometimes it means you end up with an incomplete or patch knowledge of some subjects
<0> smsie: unfortunatley, databases is one such for me, whereas it really shouldn't be (and I am correcting this, but it's going rather sluggishly)
<0> smsie: I've read books on compiler design that I found vastly more interesting than books on the relational model ;)
<1> wlfshmn: that's cos the relational model is boring :)
<1> and compiler design is actually quite interesting
<0> alter table ac_item drop foreign key FKB9986D10D3D2B8FC;
<0> alter table ac_manufactureralias drop foreign key FKCB471E422EDD6BC2;



<0> alter table ac_manufactureralias drop foreign key FKCB471E42B6C9AAF3;
<0> eek
<0> sorry about that, and let's be thankfull putty nowdays doesn't default to leting you paste infinei amoutns of text ;)
<2> sorry
<2> back from phone
<2> reading
<1> right click paste is a pain at times
<0> smsie: well, you've seen the amounts of SQL I've pasted over the years ;)
<2> ok, so the problem is that
<2> item_itemKey
<1> yeah, I have plebs for that :)
<2> in ite, you should have : id
<2> oon price: id, item_id
<1> they'#re all convinced my job is HARD
<1> I hope they never work it out
<0> kinematix: I don't as of yet have any data in there, so I don't know what hibernate intends to put in it, but form the length defined, it intends to put a single key in there, probably the itemKey, which would mean itemKey is specified twice in each row
<2> in item, you shoudl have your @id defined, in price, a many-to-one to item, with key = item_id
<2> oh I have an idea!
<0> kinematix: ah, so on 'price', itemKey should be the @id? currenlty it's priceKey that is @id
<2> no
<2> Price has its own Price_Id and shoud have a Item_Id (generated from the many-to-one)
<2> the many-to-one takes the Key you give it and create a column from it
<2> ok try somethign
<2> pk^
<0> kinematix: ok. I do't need to annote itemKey in 'price' in any special way then? it's annoted @Basic currently



<2> ok?
<2> drop the one-to-many relation
<2> and tell me if the tables are right now
<2> no
<2> look
<2> Price object shoudl have a Item reference
<2> this reference should be annotated as a many-to-one
<0> if I drop the onetomany (in 'item') I still have the item_itemKey field in 'price'
<2> ok
<2> that<s the point
<2> that's the point
<2> you defined item key 2 times
<2> you should simply
<2> define the reference to Item
<2> and annotate it as a many-to-one
<2> this will generate the column field
<0> kinematix: hang on, the item reference should be annoted many to one?
<2> yes
<2> of course
<2> from price
<0> the itemKey?
<2> there are many prices for one item
<2> look
<2> there is a Item refernce
<2> but you don't to define another field "itemkey"
<2> nor to map it
<2> you get the point?
<2> when you define a many-to-one, you always do it on a referenced object
<2> and a column is automatically created from it in the mapped table


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #java
or
Go to some related logs:

#php
oxxa barra
what alcohool does to your liver
tomcat fedora gcj JAVA_HOME
resimtakasi
#linux
#asm
#chatzone
#asm
valantis server



Home  |  disclaimer  |  contact  |  submit quotes