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. About sql-type it is an attribute of column tag (note a property can be represented in more than one column). entity-name is documented in various posts and in the coming soon : NHibernTe 3 Cookbook
-- 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/sqlparam > eter-dbtype-dbtype-time-sets-the-parameter-to-sqldbtype-datetime-instead-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]. >> 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.
