Man! Really I don't understand.... You askednfor entity-name and I send you some link and how I'm looking for Nh's related things
-- Fabio Maulo El 04/09/2010, a las 08:47, Frans Bouma <[email protected]> escribió: >> We have it already in NH. >> The problem is, as said, that there isn't a DbType for NVARCHAR(MAX) and > for >> DbType.Date and DbType.Time Ms has 2 of its own SqlBlahParameter. >> >> About entity-name: >> http://tinyurl.com/2vhhjck > > btw, pretty stupid reply by you. I now see where the link goes to. > Please don't treat me like a little toddler, as I can do the same to you. > > If you had looked more closer, I was interested in 'entity-name' for > the element 'many-to-many', not for 'class'. That's why I couldn't find any > info. If it means the same as on 'class' then that's useful info, but not > entirely obvious IMHO. > > FB > >> the first two links are >> http://nhforge.org/blogs/nhibernate/archive/2008/10/21/entity-name-in- >> action-a-strongly-typed-entity.aspx >> <http://nhforge.org/blogs/nhibernate/archive/2008/10/21/entity-name-in- >> action-a-strongly-typed-entity.aspx> >> http://nhforge.org/blogs/nhibernate/archive/2008/10/31/entity-name-in- >> action-entity-abstraction.aspx >> >> >> On Sat, Sep 4, 2010 at 7:16 AM, Frans Bouma <[email protected]> wrote: >> >> >> > NH does not have any workaround to fix Time and Date issues; Ms >> should >> > respect its rules instead fix some rule and then do anything else. >> >> >> yeah, I agree, though debates with the team have lead to the >> conclusion for them that they won't change it. :/ >> >> >> > About sql-type it is an attribute of column tag (note a property >> can be >> > represented in more than one column). >> >> >> Ok. Here's a thought: >> - if you make sql-type part of 'property' as well, and IF it's >> specified you >> can use it to obtain the real <provider specific>DbType enum value >> and then >> set the real type enum property on the DbParameter instance. >> - at startup you obtain the enum type, by using a name stored in the >> dialect, e.g. OracleDbType. >> - you also create at startup a delegate at runtime with IL which > will >> set >> the specific enum type property (obtained through reflection from a >> dbparameter instance, and with a name stored in the dialect). >> - When you create a parameter, you use the name stored in sql-type > to >> obtain >> the enum value, use that value with the in-memory created delegate > to >> set >> the specific type. >> >> This can be done in generic code. >> >> >> > entity-name is documented in various posts and in the coming soon > : >> > NHibernTe 3 Cookbook >> >> >> I must have used the wrong google search terms then, because I >> couldn't find >> anything. Anyway, it was a wild guess if it would help me with the >> problem I >> had in another thread. >> >> FB >> >> >> > >> > -- >> > Fabio Maulo >> > >> > >> > El 03/09/2010, a las 06:31, Frans Bouma <[email protected]> escribió: >> > >> > >> On Thu, Sep 2, 2010 at 16:13, Frans Bouma <[email protected]> wrote: >> > >> > Look closer, it's right there :-) >> > >> > >> > >> > Schema: >> > >> > <xs:element name="property"> >> > >> > <xs:complexType> >> > >> > ... >> > >> > <xs:attribute name="type" type="xs:string" /> > <xs:attribute >> > >> name="column" >> > >> > type="xs:string" /> <xs:attribute name="length" >> > >> type="xs:positiveInteger" >> > >> /> >> > >> > <xs:attribute name="precision" type="xs:positiveInteger" > /> >> > >> <xs:attribute >> > >> > name="scale" type="xs:nonNegativeInteger" /> ... >> > >> > >> > >> > Example: >> > >> > <property name="StringData" length="100" /> >> > >> >> > >> >> > >> v3 specific? >> > >> >> > >> I looked at the nhforge ref docs and it wasn't there. >> If this >> > >> is >> > >> already valid for v2.1, I'll add support for it very soon > :). >> When >> > >> these >> > >> elements are available in the mappings, the dialect picks >> them up >> > > for >> > >> parameter production like the call you showed in a query? >> > >> >> > >> It's missing in the docs (patch welcome ;-)), but it's in the >> schema. >> > >> And yes, it's used when creating the parameters. >> > > >> > > Ok! I checked the .xsd, and indeed they're there. One >> important >> > > element is missing though: sql-type (not from the xsd, but as an >> > > element to support it). You can use that at runtime to set the > DB >> > > specific type in the parameter (instead of using the buggy > DbType >> > > property) using a simple enum type lookup and an IL based >> property >> > > setter you generate at runtime at startup in the dialect. I >> haven't >> > > checked how NH works around this issue >> > > >> (https://connect.microsoft.com/VisualStudio/feedback/details/381934/sq >> > > lparam >> > > > eter-dbtype-dbtype-time-sets-the-parameter-to-sqldbtype-datetime- >> inste >> > > ad-of- >> > > sqldbtype-time) where sqlserver 2008's Time type requires you to >> set >> > > the SqlDbType property on the SqlParameter to Time, because >> setting >> > > DbType to Time or anything else will set SqlDbType to DateTime, >> which >> > > will cause an exception. The only way to set it properly is to >> set the >> > > SqlDbType property of the SqlParameter object to Time. ('Date' >> has the >> > > same problem). Haven't checked, perhaps NH has specific code to >> work >> > > around this issue. Using the type specification in the mapping >> would >> > > help get around this, as can then simply use generic code to set >> parameter >> > types. >> > > >> > > Glancing over the xsd, there are many elements which have >> attributes >> > > which are undocumented. The main problem I have with providing >> docs >> > > for this is ... where to get the info from? :). >> > > length/precision/scale... that's obvious. But for example the >> > > <many-to-many> element has a lot of attributes which aren't in >> the >> > documentation (also not in the Hibernate docs btw). E.g. >> > > what does entity-name do as attribute?. Is there a source > (except >> > > hunting down a code path through the sourcecode) where this info >> is >> > > obtainable from so a more complete xml reference doc can be >> created? >> > > >> > > FB >> > > >> > >> >> > >> Diego >> > >> >> > >> -- >> > >> 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] >> <mailto:nhusers%[email protected]> . >> > >> For more options, visit this group at >> > >> http://groups.google.com/group/nhusers?hl=en. >> > > >> > > >> > > -- >> > > 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] >> <mailto:nhusers%[email protected]> . >> > > For more options, visit this group at >> > http://groups.google.com/group/nhusers?hl=en. >> > > >> > >> > -- >> > 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] >> <mailto:nhusers%[email protected]> . >> > For more options, visit this group at >> > http://groups.google.com/group/nhusers?hl=en. >> >> -- >> 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] >> <mailto:nhusers%[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. > > > -- > 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. > -- 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.
