fluent-nhibernate icon indicating copy to clipboard operation
fluent-nhibernate copied to clipboard

Fluent index creation

Open jagregory opened this issue 14 years ago • 2 comments

Patch from Robert, not sure why this never got applied. Will review post-1.1.

public class Indexes : FluentIndexBase
{
  public Indexes(Configuration configuration)
      : base(configuration)
  {
      AddDialectScope("NHibernate.Dialect.MsSql2005Dialect");

      ClusteredIndex<Person>().OnPrimaryKey();
      UniqueNonClusteredIndex<Person>().OnProperty(x => x.SSN);

      ClusteredIndex<SuperClass>().OnProperty(x => x.Person);
      UniqueNonClusteredIndex<SuperClass>().OnProperty(x => x.SomeProperty);
      NonClusteredIndex<SuperClass>().OnDiscriminator();
  }
}

jagregory avatar Jul 21 '11 22:07 jagregory

Patch here: https://gist.github.com/1098406

jagregory avatar Jul 21 '11 22:07 jagregory

was this applied already?

firo222 avatar Dec 06 '12 05:12 firo222

No it wasn't, I'll apply this soon.

chester89 avatar Jul 26 '13 15:07 chester89