gnue-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: relations between tables


From: Theanoula
Subject: Re: relations between tables
Date: Mon, 04 Mar 2013 11:11:21 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20120922 Icedove/3.0.11

στις 04/03/2013 10:08 πμ, O/H Reinhard Müller έγραψε:
Dear Theanoula,

Am Sonntag, 3. März 2013, 20:48:36 schrieb Theanoula:
<datasource name="dts_customer" connection="gnue" table="transactor" />

<datasource name="dts_cars" connection="gnue" table="cars"
  master="dts_customer" masterlink="id" detaillink="customer_id" />

<datasource name="dts_contract" connection="gnue" table="contract"
  master="dts_cars" masterlink="id" detaillink="car_id" />


I have created the primary and foreign keys in the database.
When I search(in the form) in dts_customer.name I get all the info I need.
The same happens when I search in dts_cars.car_number(I get everything) but
when I search in dts_contract.contract_no I don't get the right info.
I haven't really worked with gnue-forms much lately (unfortunately), but IIRC,
chained master-detail has some issues in forms.

Having said that, I would suspect that actually this is not a pure linear
chained master-detail: isn't the contract the thing that connects customers
and cars? So actually dts_cars is a detail to dts_customer, but dts_contract
would also be a detail to dts_customer?

Thinking even more about it: can there be more than one contract per car? Or
wouldn't contract and car be an 1:1 relationship, meaning that you could put
both in the same table?

Just thinking out loud...

Thanks,
Reinhard

Hi!

Good thinking but I need to explain. The customer is connected with cars and the car with the contract(the primary key of the car is in contract as foreign key) which means that one car can have many contracts. So I think that I can't put both in the same table.
Is this relation possible?

Thanks

Thea



reply via email to

[Prev in Thread] Current Thread [Next in Thread]