Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[java] Java Persistence API (JPA) Entity Rule: Top Level Class #2855

Open
numeralnathan opened this issue Oct 22, 2020 · 0 comments
Open

[java] Java Persistence API (JPA) Entity Rule: Top Level Class #2855

numeralnathan opened this issue Oct 22, 2020 · 0 comments
Labels
a:new-rule Proposal to add a new built-in rule

Comments

@numeralnathan
Copy link

Proposed Rule Name: JPATopLevelClass

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 class to be a top-level class.

Note: Hibernate does not have this requirement. So, those using Hibernate will need to disable this rule.

Code Sample:

The following class will cause a problem at runtime because it is a nested class.

class MyClass
{
   @Entity
   class MyEntity
   {
      ...
   }
}

Possible Properties:

I cannot think of any. Can you?

@numeralnathan numeralnathan added the a:new-rule Proposal to add a new built-in rule label Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:new-rule Proposal to add a new built-in rule
Projects
None yet
Development

No branches or pull requests

1 participant