subtype identifying key

Posts   
 
    
e106199
User
Posts: 175
Joined: 09-Sep-2006
# Posted on: 04-Jul-2011 19:24:27   

Hi, just upgraded into 3.1 and one of the major change seems to be a problem. in version 2 the subtype had its own identifying key and but version 3 wont let it.

i had a user entity and its subtype student. user had userid and student had studentid. so all student related methods including ui is using studentid as the student identifier. now v3 is forcing me to use student.userid.

i have used student.studentid in many places including ui bindings. is there a way to still use it or do i have to go through all the code and change student.studentid into student.userid ?

thanks -shane

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 05-Jul-2011 03:44:20   

e106199 wrote:

is there a way to still use it or do i have to go through all the code and change student.studentid into student.userid ?

You will have to go through all code and chance the field name. Sorry, but this is a braking chance so you have to do it in order to compile your code. With some refactor mechanisms this could be done easily hopefully.

David Elizondo | LLBLGen Support Team
e106199
User
Posts: 175
Joined: 09-Sep-2006
# Posted on: 05-Jul-2011 07:08:19   

that's not good... and unfortunately i keep facing new exceptions.

i have role, module, and rolemodule tables. rolemodule is the intermediate table between role and module tables.

in v2 i had the following: role.ModuleCollectionViaRoleModuleAcces

now in v3 i get an exception. looked for something similar but cant seem to find one.

does it have a replacement? thanks

-shane

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 05-Jul-2011 11:18:24   

For the first problem you can add a simple property StudentId to a partial class.:

public int StudentId
{
    get { return UserId;}
    set { this.UserId = value;}
} 

For the m:n intermediate entity, pleasse check the following thread: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=18058

e106199
User
Posts: 175
Joined: 09-Sep-2006
# Posted on: 05-Jul-2011 17:14:44   

thanks for the pointer.

"In general, you shouldn't add them automatically, as you'd get many unwanted m:n relationships as well, so add the ones you want manually. "

how do i add the ones i want manually? is it through the designer?

thanks again -shane

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 05-Jul-2011 17:40:37   

Yes, by adding a new M:N relationship. Right click 'Relationships' below the entity you want to define the m:n relationship for, or click the button in the toolbar.

Frans Bouma | Lead developer LLBLGen Pro