factories for inherited entities?

Posts   
 
    
ChBaeumer
User
Posts: 175
Joined: 23-Oct-2003
# Posted on: 13-Sep-2007 12:58:56   

Hi,

is there a simple way to get a factory based on the discriminator of an entity?

Curious

Christoph

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 13-Sep-2007 17:22:33   

Would you please elabprate more on what you need and why do you need it for? Thanks.

ChBaeumer
User
Posts: 175
Joined: 23-Oct-2003
# Posted on: 14-Sep-2007 11:26:46   

Hi,

following scenerio:

I export data from my model using datasets and write them to xml. On the other side I import this data. Now I want to create new entities from the import data. In order to instanciate the correct entities I need the correct factory which is available in the InheritanceProvider but not easily accessible since the only available method needs data which I do not have.

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 14-Sep-2007 12:11:34   

I export data from my model using datasets and write them to xml.

Why are you using dataSets? LLBLGen Pro supports XML serialization. Please check the LLBLGen Pro manual "Using the generated code -> XML Support (serialization, de-serialization)" As far as I remember, the Entity Factory gets generated in the XML (not in the Compact25 type)

ChBaeumer
User
Posts: 175
Joined: 23-Oct-2003
# Posted on: 14-Sep-2007 14:15:02   

Hmm,

I know that there is an xml serialization.

  1. I'm not quite sure how to exclude entities from being serialized
  2. Due to some some restrictions some entities have to be transformed in an other format

For me it was easier to map them to an dataset since in this way I get more control over what should be serialized.

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 14-Sep-2007 17:20:37   

I'm not sure I understand you correctly.

WriteXML() is called from eithin the entity. So you can do your checks and only serialize those entities that meet the requirments, by calling their WriteXML() method.

ChBaeumer
User
Posts: 175
Joined: 23-Oct-2003
# Posted on: 21-Sep-2007 09:34:16   

Hi Walaa,

sorry for not answering. I don't ment to be rude flushed

Thank you for your answers.

Christoph