Hibernate's lazy loading allows you to retrieve just the data of the current class without being forced to load all its related classes. For instance with lazy loading, you can pull up an instance of a ``++Lecture++`` ``++@Entity++`` without being forced to load all its ``++Student++``s. 


But that's only if you're storing the ``++Student++``s in a collection. Store them in an array instead, and the benefits of lazy loading are no longer available.


This rule raises an issue on each array in ``++@Entity++`` classes.


== Noncompliant Code Example

----
@Entity
public class Lecture {

  @OneToMany
  private Student [] attendees;  // Noncompliant
  // ...
}
----


== Compliant Solution

----
@Entity
public class Lecture {

  @OneToMany
  private List<Student> attendees;
  // ...
}
----


