1:1 Table to View

Posts   
 
    
arschr
User
Posts: 894
Joined: 14-Dec-2003
# Posted on: 03-Jun-2006 18:00:07   

I've an Entity (Invoice) and a view that I know is 1 to 1 with it. I don't see how to make this happen in the designer?

O.K. I had already built the relationship so the Is part of primary key check box on the view field was disabled. There is then no way to delete the relationship without deleteing the entity. (Is this true?).

I deleted the entity and readded it it. Set the is part of primary key flag on the key field. Then added the relationship and it was identified as 1:1.

So I have it working, but the sequence needed may need to be documented.

Also if more than one field is set as "part of the primary key" is there a way to specify sequence?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 03-Jun-2006 18:22:01   

arschr wrote:

I've an Entity (Invoice) and a view that I know is 1 to 1 with it. I don't see how to make this happen in the designer?

Normally you'd map an entity on the view, set the PK field(s) for that entity, then create the relation

O.K. I had already built the relationship so the Is part of primary key check box on the view field was disabled. There is then no way to delete the relationship without deleteing the entity. (Is this true?).

You can remove custom relations simple_smile go into the entity editor, click the relations tab, select the relations you want to remove (custom only) and in the action button (or rightclick context menu) select remove both sides. And they're gone simple_smile

I deleted the entity and readded it it. Set the is part of primary key flag on the key field. Then added the relationship and it was identified as 1:1.

So I have it working, but the sequence needed may need to be documented.

Also if more than one field is set as "part of the primary key" is there a way to specify sequence?

You can specify a sequence per field. Not per 2 fields. Just select the field, check it's Is identity field checkbox and select the sequence.

Frans Bouma | Lead developer LLBLGen Pro
arschr
User
Posts: 894
Joined: 14-Dec-2003
# Posted on: 03-Jun-2006 18:47:04   

You can specify a sequence per field. Not per 2 fields. Just select the field, check it's Is identity field checkbox and select the sequence.

We may not be understanding each other. I don't mean a sequence provider for the primary key field (like an identity field is).

I mean, if I have a primary field made up of 2 fields (in a view) Is there a way to say the total primary key is field2+field1 vs. field1+field2?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 03-Jun-2006 18:50:37   

ah simple_smile

The PK is made of a set of fields, there's no real order in them. Do you experience issues with the order of the fields?

(if you mean, the PK is one field, and the value is field1 + field2, then you can't. )

Frans Bouma | Lead developer LLBLGen Pro
arschr
User
Posts: 894
Joined: 14-Dec-2003
# Posted on: 03-Jun-2006 18:54:47   

Do you experience issues with the order of the fields?

No, not so far.