Ido Barash
Ido Barash

Reputation: 5142

NHibernate Java style mapping

When you map an entity with Java Hibernate it's easy and all you have to do is annotate the class itself. For example:

@Entity
@Table(name="students")
public class Student implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    private Integer uniqid;

    @Column(name="first_name")
    private String firstName;

    @OneToMany
    @JoinColumn(name = "id")
    private List<Address> addressesList;
}

I am trying to use NHibernate on a .NET WCF project.

Can I use meta-tags to map entities like I do in Java normal hibernate?

Upvotes: 2

Views: 838

Answers (1)

Jamie Ide
Jamie Ide

Reputation: 49301

This feature is available in the NHibernate.Mapping.Attributes namespace. You can download the most recent version here for NH 3.2.0GA.

Upvotes: 1

Related Questions