question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Java Enum to PostgreSQL Enum Type lowecase

See original GitHub issue

HI,

I have issue try to implement “Mapping a Java Enum to a database-specific Enumerated column type” from https://vladmihalcea.com/the-best-way-to-map-an-enum-type-with-jpa-and-hibernate/

my case is that in my PostgreSQL I have lowercase:

CREATE TYPE STATUS AS ENUM ('active', 'inactive');

No enum constant com.amcn.api.persistence.model.AccountState.active; nested exception is java.lang.IllegalArgumentException: No enum constant com.amcn.api.persistence.model.AccountState.active
org.springframework.dao.InvalidDataAccessApiUsageException: No enum constant com.amcn.api.persistence.model.AccountState.active; nested exception is java.lang.IllegalArgumentException: No enum constant com.amcn.api.persistence.model.AccountState.active

Caused by: java.lang.IllegalArgumentException: No enum constant com.amcn.api.persistence.model.AccountState.active
	

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
vladmihalceacommented, Jun 2, 2022

Looks like a good implementation. I’ll add it to the current Enum types.

0reactions
vladmihalceacommented, Nov 10, 2022

@hinrik Thanks. Looking forward to it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

postgresql - How to make a ENUM data type lowercase in SQL?
CREATE TYPE location AS ENUM ( 'New York', 'Los Angeles', 'Chicago', 'London','Paris','Tokyo' );. I can't use the lower() function on it because ...
Read more >
Documentation: 15: 8.7. Enumerated Types - PostgreSQL
Enumerated (enum) types are data types that comprise a static, ordered set of values. ... operators and related aggregate functions are supported for...
Read more >
MySQL 8.0 Reference Manual :: 11.3.5 The ENUM Type
An ENUM is a string object with a value chosen from a list of permitted values that are enumerated explicitly in the column...
Read more >
Java enum valueOf uppercase or lowercase - Dirask - Dirask
Does the size of letter matters when I use enum valueOf() method? For example: Can I use lowercase letters like \
Read more >
Enum Types - Java™ Tutorials
An enum type is a special data type that enables for a variable to be a set of predefined constants. The variable must...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found