Please use the google group to ask questions - thanks.

by setevoy 17 Aug 19:57
Enum type in Postgresql

Postgresql has Enum type like this:
create type "payment_type" AS enum
( 'CASH', 'COD', 'BANK', 'CREDIT' );

I tried to map using

public enum PaymentType
{
@EnumValue("CASH")
CASH ("Cash"),
...

but got an exception while saving:
org.postgresql.util.PSQLException: ERROR: column "payment_type" is of type payment_type_enum but expression is of type character varying
Hint: You will need to rewrite or cast the expression.

Does ebean supports it? Can I map enum with @EnumValue to that type?

12 Oct 10:05
by Rob

No you can not. Java enum normally map to integer or varchar.

Create a New Topic

Title:
Body:
 
Introduction User Guide (pdf) Install/Configure Public JavaDoc Whitepapers
General Database Specific Byte Code Deployment Annotations Features
Top Bugs Top Enhancements
woResponse