Hi, Fabio (or should I say, oi, Fabio!)

I don't understand what you mean. Here are my mappings:

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="NHibernateTeste" assembly="NHibernateTeste" auto-
import="true" default-access="property">
  <class name="NHibernateTeste.A, NHibernateTeste" table="A"
lazy="false">
    <id name="A1" column="A1">
      <generator class="assigned"/>
    </id>
    <property name="Text" column="A"/>
    <one-to-one name="E" property-ref="A"/>
  </class>
</hibernate-mapping>

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="NHibernateTeste" assembly="NHibernateTeste" auto-
import="true" default-access="property">
  <class name="NHibernateTeste.E, NHibernateTeste" table="E"
lazy="false">
    <composite-id name="A">
      <key-many-to-one name="A1" class="NHibernateTeste.A,
NHibernateTeste" lazy="false"/>
    </composite-id>
    <many-to-one name="A" lazy="false" unique="true"/>
    <property name="Text" column="E"/>
  </class>
</hibernate-mapping>

As you can see, A is the main class, and E holds a reference to an A
object, which is also the primary key. Where does the foreign
generator fits in?

Thanks,

Ricardo Peres








On Jun 8, 1:27 pm, Fabio Maulo <[email protected]> wrote:
> generator="foreing"
>
> 2009/6/8 Ricardo Peres <[email protected]>
>
>
>
>
>
> > Hi,
>
> > I eventually found out out to do it. Sorry, I am just starting to use
> > NHibernate...
> > Also, apologies for my other post, with a similar title: as the post
> > wouldn't show up, I sent another one...
>
> > I still have problems with the one-to-one mapping, where the mapping
> > key is also the primary key.
>
> > Regards,
>
> > RP
>
> > On Jun 8, 1:51 am, Fabio Maulo <[email protected]> wrote:
> > > That is for a new application ?
>
> > > 2009/6/7 Ricardo Peres <[email protected]>
>
> > > > Hello,
>
> > > > How can I map a many to many relationship where each related table has
> > > > composite keys?
> > > > For start, I don't need any additional attributes on the mapping
> > > > table.
>
> > > > Any ideas?
>
> > > > Thanks,
>
> > > > Ricardo Peres
>
> > > --
> > > Fabio Maulo
>
> --
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to