Well, the class library compiles without errors, but, when I create the database structure, only the tables for the base classes are mapped with the dessired relations to each other, and the table for the Application entity is mapped like if there is no inheritance on it, ad only the fields on the Application class are created the other fields of the base classes are ignored.

Serge

First of all I would like to point out that if all the classes are in one project there is absolutely no need for defining two metadata sources. However if this is the case in order for the aggregate metadata source to correctly combine two models they should have been created with the AggregationOptions.Late option. This is a parameter that is passed to the custom metadata sources that you have created. It basically means that in the models created custom artefacts will be left out that will help later on when association between models are resolved.

Also I have noticed that your setup might not be entirely correct. When using vertical mapping for inheritance you should only mark the derived classes as vertical, the base class should not be marked with Inheritance(InheritanceStrategy.Vertical).

I hope this proves to be helpful, however if you face further trouble make sure to let us know.

Abimael

I aleady tryed with the AggregationOptions.Late with the same result, I tryed removing the vertical inheritance definition for the base classes too, but removing that, all the base classes are on one table, but the Application table is created with the same problem. I will try defining the derived classes on separate projects, and let you know the results.

Thanks and best regards.

Abimael Ordonez.

Serge

I have taken the liberty of modifying you code a little in order to show you what needs to be modified. Please notice how I have added the AggregationOption.Late to the fluent metadata context constructors and not the aggregation one.

I have attached the project I used for testing this. Please note that I you are planning on keeping all of the classes in one project I suggest using a single metadata source rather than merging multiple with the AggregateMetadataSource.

Abimael

That works pefect, thats exactly what I want to do. This is not a final project, it was a proof of concept, I want to make a class library containing "base metadata" en use it on derived projects for make new ones or extend existing ones. The final base classes will be a little diferent that that, I only want to test if I can make that thing with OpenAccess, and I see that I can.

Serge

Currently there is no way to mark properties that have to be serialized to blob using the Fluent Mapping API. However based on your suggestion we will surely be adding this functionality in the next release. A workaround would be to override the CreateModel method of the FluentMetadataSource and in it find the desired persistent type, and it's property (the collection Members) they are listed as MetaMembers but you can cast some of them to MetaPrimitiveMember and set it's serialized to blob property to true.

However from your configuration TestConfBase look like another persistent type and should not be serialized to blob but rather just persisted.

I hope this is helpful. Please make sure to let us know if you face further trouble.

Abimael

The TestConfBase will be a base class for multiple derived classes that will have diferent properties, and I need that all of the derived classes be saved on the same table. Is like serializing it to a XML string and store it on a nvarchar(MAX) (SQL Server), but on a varbinary(MAX) instead. I want to make a plugin system that will have a lot of diferent plugins, each one with its own configuration properties, but sharing some of them. I'The system will have more than 30 diferent plugins, and I dont want to make 30 tables. The TestConfBase property will be edited with a PropetyGrid like control (on WPF, DotNetNuke and a linux desktop). The Application class will not be the only one with a serialized property like this, there will be some other persisted classes like that. Thats the reason that I whant a form to serialize a property (either to a BLOB file as binary data or to a nvarchar(MAX) as a XML String) and keep the table count of the system not too high.

I hope that you understand my point, and I will try your suggestion, but it will be so useful that the OpenAccess ORM has a property or something to mark a property as serialized.

Thanks a lot, and I'll contact you if I need further help.

AO.

Abimael

I tryed with the sugestion of overriding the CreateModel method, but the Member type for the TestConf property cant be casted to MetaPrimitiveMember. Can you give an code example of how to define the SerializeToBlob attribute??

Serge

Unfortunately Telerik OpenAccess ORM does not allow for you to serialize to blob persistent objects. You cannot cast the member to MetaPrimitiveMember because it is actually a MetaNavigationalMember.

However, it is quite easy to persist all of the classes that take part in the hierarchy in one table, you just have to mark the derived classes with flat inheritance, as I guess you have probably already found out.

Please elaborate a bit more if this is your case or is there something else you want to achieve.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.