which version of NH ?
If you are using NH3 then we still have some issues parsing generic types
(if so a JIRA ticket is needed).

On Fri, Feb 11, 2011 at 5:56 PM, Leonardo <[email protected]> wrote:

> What I want is to map a property that is an array (string[]) as a json
> type, if possible using xml files. I am having no issues mapping
> jsontypes of classes that are not arrays (i.e. do not have the "[]" in
> their names)
>
> On 11 feb, 17:34, Fabio Maulo <[email protected]> wrote:
> > In my case the mapping look like this:
> > public void RegisterPatterns(Mapper mapper, IDomainInspector
> > domainInspector)
> > {
> > mapper.TypeDef<Country, CountryType>();
> > mapper.TypeDef<Definition, JsonType<Definition>>();}
> >
> > Where Definition is this:
> >     public class Definition
> >     {
> >         public Definition()
> >         {
> >             Colors = new List<TrimColor>();
> >             Equipments = new List<TrimEquipment>();
> >             Specifications = new List<TrimSpecification>();
> >         }
> >
> >         public string Category { get; set; }
> >         public string Price { get; set; }
> >         public string Description { get; set; }
> >         public string Guarantee { get; set; }
> >         public string Origin { get; set; }
> >         public bool IsNew { get; set; }
> >
> >         public ICollection<TrimColor> Colors { get; set; }
> >         public ICollection<TrimEquipment> Equipments { get; set; }
> >         public ICollection<TrimSpecification> Specifications { get; set;
> }
> >     }
> >
> > The DB column is a VARCHAR(MAX)
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On Fri, Feb 11, 2011 at 5:28 PM, Leonardo <[email protected]> wrote:
> > > Hi,
> >
> > > I have a user type for saving types as Json, called JsonType<T>.
> >
> > > I also have a Mail class, with an ToAddresses property of type
> > > string[].
> >
> > > I want to map this using .hbm.xml, but if I do this in the entity
> > > mapping file:
> >
> > > <typedef class="Test.JsonType`1[System.String[]], Test" name="json" />
> >
> > > It fails with:
> >
> > > NHibernate.MappingException : Could not compile the mapping document:
> > > Test.Mappings.Mail.hbm.xml
> > >  ----> NHibernate.Util.ParserException : The brackets are unbalanced
> > > in the type name: [ystem.String[, Test]
> >
> > > How can I map this type successfully?
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "nhusers" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected].
> > > For more options, visit this group at
> > >http://groups.google.com/group/nhusers?hl=en.
> >
> > --
> > Fabio Maulo
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>


-- 
Fabio Maulo

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to