This discussion is archived
1 2 Previous Next 16 Replies Latest reply: Feb 20, 2013 8:59 PM by r035198x Go to original post RSS
  • 15. Re: help with enumerations
    REDO LOG Newbie
    Currently Being Moderated
    by the way, the enum returns the identifier by

    itemValue="#{level}"/>
    and that gives an error: "too much data for column...." it return a string instead of a single character.
  • 16. Re: help with enumerations
    r035198x Pro
    Currently Being Moderated
    REDO LOG wrote:
    Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'encryption_level' at row 1
    anyhow, thanks to all of you, you have made good efforts I appreciate that
    thanks ones again
    Maybe because you are trying to fit values like No_Encryption into a one length column. Again, JPA will use the name() of the enum if the Enum type is String. Either use ordinal and hope that you can get the numbers generated in the DB to match your data ordering of 0,1,2 or don't use an enum to map this . A third option would be to use custom providers that are persistence provider specific.
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points