[fluent-nhib] Fluent Mapping For IuserType

2011-09-07 Thread ashleyjohn
I have a type implementing IuserType in my app.I also have a
convention defined.
for this particular type i have a column in my DB which is of type
xml.Now how do i specify the mapping using Fluent?

eg:

 public class MeasuresMapping:ClassMap
{
public MeasuresMapping()
{
Table("PQRSMeasures");
Id(x => x.Id, "PQRSMeasureKey").Not.Nullable();
Map(x => x.Criteria,
"Criteria").CustomSqlType("xml").Not.Nullable();// This gives a error.
as Criteria is userdefined type..How i add the mapping here...??


}
}

class NhibernateXmlParser:IUserType
{

//implemented all the methods

//here the type returned is of same type as of the Criteria


}

class MeasureConvention : UserTypeConvention
{

}

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibernate@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.



Re: [fluent-nhib] Re: How do you figure out NHibernate.DuplicateMappingException?

2011-09-07 Thread Isaac Cambron
I know of at least one other hole in the duplicate mapping defense, which
may or may not be the same as what you're seeing. I'm planning on
pinpointing and fixing that one 'cause it's bugging me, but if can get me
something reproduceable, I'll look at yours while I'm there.

On Wed, Sep 7, 2011 at 4:24 AM, James Gregory wrote:

> The two stack traces show that the first is running through the automapper,
> and the second just a regular persistencemodel. I can't remember this part
> off the top of my head, but it does sound like it's intentional.
>
> It's quite difficult to give you any more help without either seeing how
> you're adding the mappings, or getting my hands on a reproduction. FNH
> *should* prevent duplicates from being added to NH, but there's obviously a
> hole in that defense; if you're seeing the same assembly in ScannedSources
> multiple times, then it sounds like you're adding it twice (or we've got a
> bug!). Again, hard to tell which without actually seeing something, I'm
> afraid.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Fluent NHibernate" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/fluent-nhibernate/-/f6EHwxskGB4J.
>
> To post to this group, send email to fluent-nhibernate@googlegroups.com.
> To unsubscribe from this group, send email to
> fluent-nhibernate+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/fluent-nhibernate?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibernate@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.



Re: [fluent-nhib] Re: How do you figure out NHibernate.DuplicateMappingException?

2011-09-07 Thread James Gregory
The two stack traces show that the first is running through the automapper, 
and the second just a regular persistencemodel. I can't remember this part 
off the top of my head, but it does sound like it's intentional.

It's quite difficult to give you any more help without either seeing how 
you're adding the mappings, or getting my hands on a reproduction. FNH 
*should* prevent duplicates from being added to NH, but there's obviously a 
hole in that defense; if you're seeing the same assembly in ScannedSources 
multiple times, then it sounds like you're adding it twice (or we've got a 
bug!). Again, hard to tell which without actually seeing something, I'm 
afraid.

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/fluent-nhibernate/-/f6EHwxskGB4J.
To post to this group, send email to fluent-nhibernate@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.