BlockA --------> BlockB -------> BlockC
We have 3
blocks and 2 connections. For this case the data in the table should be:
id | src |
1 | 1 |
# BlockA -> BlockB connection
2 | 2 |
# BlockB -> BlockC connection
3 | 1 |
1 # this is connection from
BlockA to itself, but this is OK (not shown on the schema
4 | 3
| 4 # wrong entry... it should
not be possible to enter something like this in a database,
block with id 4 is
should I declare classes for Block and Connection table?
in a connection table should have id and
should be a reference to an existing block, and
should be again a reference to an existing block
for your answer.
Sent: Thursday, January 08, 2009 8:39 AM
Subject: Re: FW: [SQLObject] table
I do not really understand, what you are trying to do.
Can you send me a short example of data for both tables?
On Thu, Jan 8, 2009 at 8:36 AM, Zoran Bošnjak <Zoran.Bosnjak@sloveniacontrol.si>
understand my question. Can you help me solve it?
for the confusion...
want to have a "Connection" in a database unless the connection is between
class definition for Block and Connection so, that it won't be even
possible to create such connection.
create dumb connection
# it should not work, because there is no
Why do you think this should not work? AFIK above mentioned just
insert one row (record) in your table Connection. Exactly as the SQL below
INTO "connection" VALUES(1,150,250); COMMIT;