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

Why are you calling this "Fluent" when @Annotations seem to be required

Open granadacoder opened this issue 7 years ago • 3 comments

Am I missing something?

I see annotations galore in the start up example. How is that "fluent"?

**@Entity**
**@Table(name = "users")**
public class User {

    **@Id
    @Column(name = "pid")**
    private Long pid;

    **@Column(name = "login")**
    private String login;

    **@ManyToOne
    @JoinColumn(name = "fk_department")**
    private Department department;

}

NHibernate has a Fluent implementation.

https://github.com/FluentNHibernate/fluent-nhibernate/wiki/Getting-started

public class Employee  /* << No Annotations/Attributes*/
{
  public virtual int Id { get; protected set; }
  public virtual string FirstName { get; set; }
  public virtual string LastName { get; set; }
  public virtual Store Store { get; set; }
}


public class EmployeeMap : ClassMap<Employee>
{
  public EmployeeMap()
  {
    Id(x => x.Id);  /* << FLUENT */
    Map(x => x.FirstName);  /* << FLUENT */
    Map(x => x.LastName);  /* << FLUENT */
    References(x => x.Store);  /* << FLUENT */
  }
}

granadacoder avatar Oct 26 '18 20:10 granadacoder

@granadacoder Fluent means just fluent API. It is not related to "fluent" features of NHibernate.

v-ladynev avatar Jul 08 '19 09:07 v-ladynev

https://en.wikipedia.org/wiki/Fluent_interface

It looks like the Criteria and such are fluent. But the mappings themselves are not fluent. They are annotation driven.

Just putting a clarification out there as I see it.

Thanks for your efforts on this library.

granadacoder avatar Oct 23 '19 22:10 granadacoder

@granadacoder Thank you!

v-ladynev avatar Oct 24 '19 09:10 v-ladynev