-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Can Attributes be used for IUserTypes with multiple columns?
PostPosted: Wed Dec 31, 2008 9:55 pm 
Newbie

Joined: Sun Dec 14, 2008 12:01 am
Posts: 5
Take the basic IUserType example: NHibernate.DomainModel.DoubleStringType

If I used that in a class:

Code:
public virtual DoubleStringType Test
{
get;
set;
}


How would I use NHibernate.Mapping.Attributes to give it multiple columns?

I can't seem to get multiples columns on a Property attribute. Does anyone know if there is a way to do this?

In the meantime I will try [RawXml].

Thanks,
-Nick


Top
 Profile  
 
 Post subject: In other words, how do I do this:
PostPosted: Thu Jan 01, 2009 4:58 pm 
Newbie

Joined: Sun Dec 14, 2008 12:01 am
Posts: 5
In other words, how do I do this without [RawXml]:

Code:
        [RawXml(After = typeof(IdAttribute), Content =
            "<property name=\"TestVector\">" +
                "<column name=\"TestVectorX\"/>" +
                "<column name=\"TestVectorY\"/>" +
                "<column name=\"TestVectorZ\"/>" +
            "</property>")]
        public virtual Vector TestVector
        {
            get { return _TestVector; }
            set { _TestVector = value; }
        }


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 03, 2009 5:43 pm 
Newbie

Joined: Sun Dec 14, 2008 12:01 am
Posts: 5
There has to be a sexier way to do this...anyone?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 20, 2009 6:42 pm 
Beginner
Beginner

Joined: Wed Jun 09, 2004 8:10 am
Posts: 28
As well as how to use IParameterizedType.

As I understand custom mapping can be specified as [Property(Type="...mapping class name...")]. But how can I specify parameters for this mapping class name.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 20, 2009 7:12 pm 
Beginner
Beginner

Joined: Wed Jun 09, 2004 8:10 am
Posts: 28
The answer to my question is no. I checked source code and it seems that type is written into XML as a string without any processing.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.