Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » ValidationException for enum class
ValidationException for enum class [message #954994] Tue, 23 October 2012 12:16 Go to next message
Sebastian Lorenz is currently offline Sebastian LorenzFriend
Messages: 42
Registered: November 2010
Member
I'm getting the following exception:

Caused by: Exception [EclipseLink-7151] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The type [class commons.Gender] for the attribute [gender] on the entity class [class persistence.PatientEntity] is not a valid type for an enumerated mapping. The attribute must be defined as a Java enum.


But I can't figure out why since I assume my classes to be O.K.:

public class PatientEntity implements Lockable<Long>, Identifiable<Long> {
  ...
  private Gender gender;

  @Enumerated(EnumType.STRING)
  @Column(name = "gender")
  public Gender getGender() {
    return this.gender;
  }

  public void setGender(Gender gender) {
    this.gender = gender;
  }
  ...
}

public enum Gender implements ExtendedDisplayable {

	NONE,
	MALE,
	FEMALE;

  ...
}


Btw. The excpetion appears at application startup. But the application is running without any problems. I can inssert and select patients from the database.

[Updated on: Tue, 23 October 2012 13:41]

Report message to a moderator

Re: ValidationException for enum class [message #964676 is a reply to message #954994] Tue, 30 October 2012 18:07 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

What environment are you running in? Can you include the full exception stack.
It could be some sort of class loader issues. If things are working, you may be able to just ignore the issue.


James : Wiki : Book : Blog : Twitter
Re: ValidationException for enum class [message #975026 is a reply to message #964676] Wed, 07 November 2012 14:38 Go to previous message
Sebastian Lorenz is currently offline Sebastian LorenzFriend
Messages: 42
Registered: November 2010
Member
I'm using Gemini JPA and -Blueprint. I think you are right and this has smth. to do with classloading in this environement. Thanks.
Previous Topic:TopLink to EclipseLink migration
Next Topic:@StoredProcedureParameter direction is deprecated
Goto Forum:
  


Current Time: Sat Apr 20 02:36:34 GMT 2024

Powered by FUDForum. Page generated in 0.02984 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top