Composite user type mapping fails when part of joined-subclass

6 views
Skip to first unread message

Ian Cooper

unread,
Sep 30, 2008, 8:29:28 AM9/30/08
to castle-pro...@googlegroups.com
We have hit a problem with AR generating the mappings for a Composite User Type embedded within a joined sub-class. Simply a property defined [CompositeUserType] on a class that is not the hierachy of the base will not be mapped out to a property. Switch that property to the base and it maps as required.


The following code is an example (I have not included the composite user type for space, but happy to send on request). The composite user type generates correctly (confirmed from the hbm.xml files if it is on the base, not if it is on the derived class.

Anyone come across this and know if there is a fix.


using System;

using Castle.ActiveRecord;

using Matlock.Core.Proposals.ProposalStates;

 

            [ActiveRecord(Lazy = true)]

            public class LittleTest : LittleBase
            {

                        private IProposalState currentState;

                        [JoinedKey]

                        public virtual int LittleTestId { get; set; }

                        [CompositeUserType(typeof(ProposalStateUserType), new[] { "State_Name", "State_EnteredOn", "State_ChangedBy" })]

                        public virtual IProposalState CurrentState

                        {

                                    get

                                    {

                                                return currentState;

                                    }

 

                                    set

                                    {

                                                currentState = value; currentState.EnteredOn = DateTime.Now;

                                    }

                        }

            }


           [ActiveRecord("LittleBase", Lazy = true), JoinedBase]
            public class LittleBase

            {

                        [PrimaryKey]

                        public virtual int Id { get; set; }


                        [Version]
                        public virtual int Version { get; set; }

            }


 


 
Ian Cooper

Ayende Rahien

unread,
Sep 30, 2008, 11:34:07 AM9/30/08
to castle-pro...@googlegroups.com

can you create a failing test case?

Ian Cooper

unread,
Oct 1, 2008, 9:32:13 AM10/1/08
to castle-pro...@googlegroups.com
Will do. It might be a couple of days. Do you want me to send it directly to you?
 
Ian Cooper
07970-411892 (M)

"Always acknowledge a fault. This will throw those in authority off their guard and give you an opportunity to commit more. "
Mark Twain

Ayende Rahien

unread,
Oct 2, 2008, 3:09:08 AM10/2/08
to castle-pro...@googlegroups.com
Put it here.
Reply all
Reply to author
Forward
0 new messages