Im not too familiar with NH internals, but from the looks of it, the first
is extracting the IUserType (StringType), and I bet that there isn't a Type
per Column/Length combo.

the latter is looking for the actul mapping, and there's a Column descriptor
per column, with all the needed data, so it definitely is the better choice.

I think the lookup can be beutified using Linq2Objects though

On Tue, Oct 28, 2008 at 9:06 AM, Max Rezanov <[EMAIL PROTECTED]> wrote:

>
> Hello Tuna,
>
> Tuesday, October 28, 2008, 9:26:16 AM, you wrote:
>
> TT> Using ISessionFactoryImplementor is another way.
>
> Thanks all for reply.
>
> on url
>
> http://forum.hibernate.org/viewtopic.php?p=2359467&sid=49b717c0ce3b951199590b3f90ed413f
> i find not worked solution using IClassMetadata
>
> StringType a_clmtd = (StringType)
> a_Provider.SessionFactory.GetClassMetadata(typeof(ActionDO)).GetPropertyType("Description");
> int a_len = a_clmtd.SqlType.Length;
>
> value of a_len == 0.
>
> i'm try another way:
>                NHibernate.Mapping.PersistentClass a_pc =
> NHibernateHelper.Config.GetClassMapping(typeof (ActionDO));
>                foreach (var a_item in a_pc.PropertyClosureIterator)
>                {
>                    Debug.WriteLine(a_item.Name);
>                    foreach (NHibernate.Mapping.Column a_column in
> a_item.ColumnIterator)
>                        Debug.WriteLine(a_item.Name + " -> " +
> a_column.Length);
>                }
> Output:
> Description
> Description -> 100
> Groups
>
> First way wrong?
>
>
>
>  Òåìà Äíÿ: Ó Âàñ åùå ëàïøà íà óøàõ íå îáñîõëà.
>  Äî íå ñêîðîé âñòðå÷è â àäó,
>  Max                            mailto:[EMAIL PROTECTED]
>
>
>
> >
>


-- 
Ken Egozi.
http://www.kenegozi.com/blog
http://www.musicglue.com
http://www.castleproject.org
http://www.gotfriends.co.il

--~--~---------~--~----~------------~-------~--~----~
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