User Code in CollectionClasses overwritten with Safe generation

Posts   
 
    
Posts: 8
Joined: 05-Feb-2005
# Posted on: 05-Feb-2005 22:35:15   

I'm finding any custom code put in the CollectionClasses is overwritten, unlike the code in the Entity classes. I assumed that the region "Custom User Code" in these classes meant I could add code here if needed.

I'm using Two Class scenario (Full/Sage) (VS.Net 2003) 1.0.2004.1

I also tried the Base Classes only config but had the same problem

What am I doing wrong or am I misunderstanding something?

Kind regards,

Ian Blackburn LLBLGen Pro newbie!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 06-Feb-2005 00:09:15   

Entitycollection classes are always overwritten. The 2-class scenario has 2 classes per entity: one for your code and one which is generated, though not a pair per collection.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 8
Joined: 05-Feb-2005
# Posted on: 06-Feb-2005 01:46:19   

Otis wrote:

Entitycollection classes are always overwritten. The 2-class scenario has 2 classes per entity: one for your code and one which is generated, though not a pair per collection.

Thanks Otis,

So is the "Custom User Code" region in these class in preperation for the changes you making in the next release where these regions will be untouched be the code generator?

Kind regards,

Ian

taylor74
User
Posts: 59
Joined: 06-Oct-2004
# Posted on: 06-Feb-2005 02:27:47   

IanBlackburn wrote:

Otis wrote:

Entitycollection classes are always overwritten. The 2-class scenario has 2 classes per entity: one for your code and one which is generated, though not a pair per collection.

Thanks Otis,

So is the "Custom User Code" region in these class in preperation for the changes you making in the next release where these regions will be untouched be the code generator?

Kind regards,

Ian

Ian,

I think I remember Otis posting something a couple months ago that the "Custom User Code" section would be generated by a custom user's include template. I can't explain it like he did and I can't find the post right now to point you to either. Maybe Otis should modify the remark in the code to say something along the line like "custom user template generated code".

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 06-Feb-2005 10:07:13   

IanBlackburn wrote:

Otis wrote:

Entitycollection classes are always overwritten. The 2-class scenario has 2 classes per entity: one for your code and one which is generated, though not a pair per collection.

Thanks Otis,

So is the "Custom User Code" region in these class in preperation for the changes you making in the next release where these regions will be untouched be the code generator? Ian

No, that region is for include code via a template you bind yourself to the templateID stated in the region in the actual template, for example Custom_EntityAdapter will be the ID for the include template included in the custom user code region in an adapter's entity class.

The region is not properly named and will be renamed.

In the upgrade now in development, a new feature will be added where you can add code to sections which have the same name as a TDL statement in the template, at that same spot. That way, your code will be preserved and will be merged with the genreated code.

The only problem with that is that code in a given scope (for example inside a forloop in a method) also has to be merged in the same scope in the generated code simple_smile . What I want is that certain methods can be extended in code by you for example the init class methods, updateentity method etc. without the need for inheritance.

Frans Bouma | Lead developer LLBLGen Pro