Help Self Servicing issues.

Posts   
 
    
tron
User
Posts: 2
Joined: 15-Apr-2005
# Posted on: 03-May-2005 00:55:15   

Hi, First thanks for the great product, you've thought of everything! My company is now in the process of purchasing a license. Should be sometime this week.

Version: LLBLGen Demo version 1.0.2004.1 final build with the self servicing templates. ( I'm having troubles getting the latest demo from your website. The download constantly times out ).

Server: Server SQL Server 2000 sp3

I have three tables with a parent child relation ( no nulls, enforce referential integrity ) Account -> Address -> State

When trying to do the following

AccountEntity account = new AccountEntity( ); account.Address.StateId = "OR";

The call succeeds, but when inspecting the value of StateId it is set to "";

This at one time worked, but fails to do so now. The only thing that has changed is the machine in which the project was originally created on. I've tried uninstalling the demo, deleting the project, then re-installing and regenerating the project. I'm running out of options. Could this be a limitation of the demo?

Any help would be appreciated. I'm sure this is a user error, but have yet to find it. Thanks again for the great product. Clay

jeffreygg
User
Posts: 805
Joined: 26-Oct-2003
# Posted on: 03-May-2005 06:28:32   

tron wrote:

Hi, First thanks for the great product, you've thought of everything! My company is now in the process of purchasing a license. Should be sometime this week.

Version: LLBLGen Demo version 1.0.2004.1 final build with the self servicing templates. ( I'm having troubles getting the latest demo from your website. The download constantly times out ).

Server: Server SQL Server 2000 sp3

I have three tables with a parent child relation ( no nulls, enforce referential integrity ) Account -> Address -> State

When trying to do the following

AccountEntity account = new AccountEntity( ); account.Address.StateId = "OR";

The call succeeds, but when inspecting the value of StateId it is set to "";

This at one time worked, but fails to do so now. The only thing that has changed is the machine in which the project was originally created on. I've tried uninstalling the demo, deleting the project, then re-installing and regenerating the project. I'm running out of options. Could this be a limitation of the demo?

Any help would be appreciated. I'm sure this is a user error, but have yet to find it. Thanks again for the great product. Clay

Hi, there. It's been a while since I've used Self Servicing, but I think you have to explicitly initialize the Address entity then manually associate them if you're dealing with new entities:



AccountEntity account = new AccountEntity();
AddressEntity address = new AddressEntity();
address.StateID = "OR";
account.Address = address;


I could be wrong here though...

Jeff...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 03-May-2005 10:25:36   

tron wrote:

First thanks for the great product, you've thought of everything! My company is now in the process of purchasing a license. Should be sometime this week.

Thanks! smile

Version: LLBLGen Demo version 1.0.2004.1 final build with the self servicing templates. ( I'm having troubles getting the latest demo from your website. The download constantly times out ).

Please use the mirror instead if you have this problem and also disable download enhancers like getright.

Server: Server SQL Server 2000 sp3

I have three tables with a parent child relation ( no nulls, enforce referential integrity ) Account -> Address -> State

When trying to do the following

AccountEntity account = new AccountEntity( ); account.Address.StateId = "OR";

The call succeeds, but when inspecting the value of StateId it is set to "";

This at one time worked, but fails to do so now. The only thing that has changed is the machine in which the project was originally created on. I've tried uninstalling the demo, deleting the project, then re-installing and regenerating the project. I'm running out of options. Could this be a limitation of the demo?

No, you made a tiny mistake. The following line: account.Address.StateId = "OR";

loads 'Address' for 'account' using lazy loading. As account is new, it's not in the database and you'll get a new entity. Because load from the database hasn't succeeded, the next time you access that property, the entity will be loaded from the db again. So as Jeff answered, you have to explicitly set the related entity.

Frans Bouma | Lead developer LLBLGen Pro