Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] List of enum in Entity (JPA2.0)?

Hi,

I just change the Permission class from an entity to enum for simplicity, but it causes errors (the partial stack trace is at the end).

Is it supported?

@Entity
public class Role {
 
  public static final String NORMAL_ROLE = "normal";
  public static final String ADMIN_ROLE = "admin";
 
  public static final String QUERY_SELECT_ALL = "select r from Role r";
 
  @Id
  private String id;
  private String name;
  //@ManyToMany(cascade = {CascadeType.ALL})
  List<Permission> permissions;
 
  ...
}

ERROR:
org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00904: "PERMISSIONS": invalid identifier

Error Code: 904
Call: SELECT ID, NAME, PERMISSIONS FROM ROLE WHERE (ID = ?)
    bind => [normal]
Query: ReadObjectQuery(name="readObject" referenceClass=Role sql="SELECT ID, NAME, PERMISSIONS FROM ROLE WHERE (ID = ?)")
    at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:333)
    at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:644)
    ...

--
Regards,
Warren Tang

Back to the top