As I said, I tried the actual mapping and it fails with an error, "property mapping has wrong number of columns", indicating it requires a column attribute that is missing. This is NHibernate 2.1.2, with the schema that came from that distribution.
Sandro On Nov 9, 5:01 pm, Fabio Maulo <[email protected]> wrote: > probably you have the wrong schema linked to VisualStudio > <xs:element name="many-to-one"> > <xs:complexType> > <xs:sequence> > <xs:element ref="meta" minOccurs="0" maxOccurs="unbounded" /> > <xs:choice minOccurs="0" maxOccurs="unbounded"> > <xs:element ref="column" /> > <xs:element ref="*formula*" /> > </xs:choice> > </xs:sequence> > <xs:attribute name="name" use="required" type="xs:string" /> > <xs:attribute name="access" type="xs:string" /> > <xs:attribute name="class" type="xs:string" /> > <xs:attribute name="entity-name" type="xs:string" /> > <xs:attribute name="column" type="xs:string" /> > <xs:attribute name="not-null" type="xs:boolean"> > </xs:attribute> > <xs:attribute name="unique" default="false" type="xs:boolean"> > </xs:attribute> > <xs:attribute name="unique-key" type="xs:string" /> > <xs:attribute name="index" type="xs:string" /> > <xs:attribute name="cascade" type="xs:string" /> > <xs:attribute name="outer-join" type="outerJoinStrategy"> > </xs:attribute> > <xs:attribute name="fetch" type="fetchMode"> > </xs:attribute> > <xs:attribute name="update" default="true" type="xs:boolean"> > </xs:attribute> > <xs:attribute name="insert" default="true" type="xs:boolean"> > </xs:attribute> > <xs:attribute name="optimistic-lock" default="true" type="xs:boolean"> > </xs:attribute> > <xs:attribute name="foreign-key" type="xs:string" /> > <xs:attribute name="property-ref" type="xs:string" /> > <xs:attribute name="*formula*" type="xs:string" /> > <xs:attribute name="lazy" type="laziness"> > </xs:attribute> > <xs:attribute name="not-found" default="exception" type="notFoundMode"> > </xs:attribute> > <xs:attribute name="node" type="xs:string" /> > <xs:attribute name="embed-xml" default="true" type="xs:boolean"> > </xs:attribute> > </xs:complexType> > </xs:element> > > > > On Tue, Nov 9, 2010 at 2:38 PM, naasking <[email protected]> wrote: > > I have intellisense enabled, and "formula" does not appear as an > > option for many-to-one, only for "property" elements. This is entity > > references itself, so I don't think that will work. > > > Sandro > > > On Nov 9, 12:15 pm, Fabio Maulo <[email protected]> wrote: > > > Have you tried the tag 'formula' and you have some problem ? > > > > On Tue, Nov 9, 2010 at 12:40 PM, naasking <[email protected]> wrote: > > > > I have a class that evolves in a very well-defined way, such that > > > > given an arbitrary entity, I can compute the primary key of the > > > > previous entity. I'd like the entity to be loaded as a node in a > > > > linked list, with each entity having a "Previous" property which is > > > > loaded lazily using this formula, so I can traverse the history if I > > > > like. > > > > > In other words, no direct reference to the previous entry is stored in > > > > the current entry, but a formula is available to compute the previous > > > > key. Can I load a many-to-one using a formula this way? > > > > > Sandro > > > > > -- > > > > 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]<nhusers%[email protected]> > > <nhusers%[email protected]<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]<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.
