Compile errors on SerializeOwnedData

Posts   
 
    
rboarman
User
Posts: 83
Joined: 01-Feb-2005
# Posted on: 11-Jun-2009 00:03:47   

Hello,

I just upgraded our project from 2.0 to 2.6.8.1114. My issue is that I am getting compile errors when trying to create a partial class.

Errors:

Error 2 'DoveBid.Data.Generated.DamClientDb.EntityClasses.InvoicesEntity.SerializeOwnedData( SD.LLBLGen.Pro.ORMSupportClasses.SerializationWriter, object)': no suitable method found to override C:\DoveBidProjects\DoveBid\DoveBid2005\Data\Generated\DAM_ClientDB\InvoicesEntityHelper.cs 23 33 DoveBid.Data.Generated.DamClientDb

Error 3 'DoveBid.Data.Generated.DamClientDb.EntityClasses.InvoicesEntity.DeserializeOwnedData( SD.LLBLGen.Pro.ORMSupportClasses.SerializationReader, object)': no suitable method found to override C:\DoveBidProjects\DoveBid\DoveBid2005\Data\Generated\DAM_ClientDB\InvoicesEntityHelper.cs 29 33 DoveBid.Data.Generated.DamClientDb

This is new code which is not part of the upgrade. My code:


using SD.LLBLGen.Pro.ORMSupportClasses;

namespace DoveBid.Data.Generated.DamClientDb.EntityClasses
{
    public partial class InvoicesEntity 
    {

        protected override void SerializeOwnedData(SerializationWriter writer, object context)
        {
            base.SerializeOwnedData(writer, context);
        }

        protected override void DeserializeOwnedData(SerializationReader reader, object context)
        {
            base.DeserializeOwnedData(reader, context);
        }

    }
}

My InvoicesEntity class is declared as follows:

public partial class InvoicesEntity : CommonEntityBase, ISerializable

I also found that I needed to manually add in the SD.Tasks.SelfServicing.CommonBaseClassGenerator task in order to get the CommonEntityBase class to generate.

Please help.

My goal is to compress and decompress a field on this entity when it is saved or retrieved.

Thank you,

Rick

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 11-Jun-2009 04:44:27   

Did you re-generatethe code, right? Did you change the root namespace?

David Elizondo | LLBLGen Support Team
rboarman
User
Posts: 83
Joined: 01-Feb-2005
# Posted on: 11-Jun-2009 05:49:46   

I regenerated and did not change any settings.

Rick

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 11-Jun-2009 07:54:41   

Where did you put the partial class?

rboarman
User
Posts: 83
Joined: 01-Feb-2005
# Posted on: 11-Jun-2009 17:23:13   

In the root of the project just above the entity folder. A screenshot is attached.

I also attached the actual files involved.

Rick

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 12-Jun-2009 10:19:47   

I can't reproduce it, are you using .NET 3.5? or another version, please specify.

Using VS2008 / .NET 3.5, the following did compile with no errors:

namespace eFile.EntityClasses
{
    public partial class AspnetUsersEntity
    {
        protected override void SerializeOwnedData(SerializationWriter writer, object context)
        {
            base.SerializeOwnedData(writer, context);

        }
    }
}

this is a new class I created in the root of the DBGeneric project of asolution I'm currently working on.

(EDIT) I was using Adapter, but you are using SelfServicing, and there is no such methods to override in selfservicing.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 12-Jun-2009 15:53:35   

SerializeOwnedData is a fastserialization related method and fast serialization is only available to adapter. Did you generate adapter code?

Frans Bouma | Lead developer LLBLGen Pro
rboarman
User
Posts: 83
Joined: 01-Feb-2005
# Posted on: 12-Jun-2009 18:48:36   

Ahh! That's it then. The whole program is using SelfServicing.

Is there any way to accomplish what I am trying to do using SelfService?

I need to compress and decompress a field on my table when written to or read from.

Thanks,

Rick

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 13-Jun-2009 11:26:18   

You should use a typeconverter. The type converter simply converts to the same type (though it can be any type of course) and decompresses when converting from db value to in-memory value and compresses on its way to the db. This is transparent for you and it's used by the framework whenever the field is used (even in typed lists) simple_smile

Frans Bouma | Lead developer LLBLGen Pro