You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a class is annotated with JPA's @Entity, there are certain requirements placed on the class. Please create a rule that requires the instance variables to be non-final.
Note: Hibernate allows for final instance variables but lazy-loading will not work.
Code Sample:
The following class will cause a problem at runtime because it has a final instance variable.
@Entity
class MyEntity
{
private static final COUNT = 5;
private final int m_data;
}
The following class is correct.
@Entity
class MyEntity
{
private static final COUNT = 5;
private int m_data;
}
Possible Properties:
Can you think of some properties?
The text was updated successfully, but these errors were encountered:
Proposed Rule Name: JPANonFinalInstanceVariables
Proposed Category: Bug
Description:
When a class is annotated with JPA's
@Entity
, there are certain requirements placed on the class. Please create a rule that requires the instance variables to be non-final
.Note: Hibernate allows for
final
instance variables but lazy-loading will not work.Code Sample:
The following class will cause a problem at runtime because it has a
final
instance variable.The following class is correct.
Possible Properties:
Can you think of some properties?
The text was updated successfully, but these errors were encountered: