October 22, 2024
Chicago 12, Melborne City, USA
java

Which approach is more efficient with hibernate


Let's consider a class Transaction

@Entity
public class Transaction {

@ManyToOne(fetch = FetchType.EAGER)
private Business business;

    @Column(name = "business_code")
    private String businessCode;


}

which method is more efficient to fetch transactions by business using byBusinessCode which is a column in the table Transaction or using byBusiness so the whole object Business which is a dependency in the class Transaction ?



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video