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.

Error in table with ENUM field.

See original GitHub issue

I have a MySQL database with the following table


…when I run the program thows the following Exception

	at org.springframework.boot.SpringApplication.callRunner( [spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]
	at org.springframework.boot.SpringApplication.callRunners( [spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]
	at [spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]
	at [spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]
	at [spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]
	at org.blackdread.sqltojava.SqlToJavaApplication.main( [classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171]
	at sun.reflect.NativeMethodAccessorImpl.invoke( ~[na:1.8.0_171]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke( ~[na:1.8.0_171]
	at java.lang.reflect.Method.invoke( ~[na:1.8.0_171]
	at [spring-boot-devtools-2.1.8.RELEASE.jar:2.1.8.RELEASE]
Caused by: java.lang.IllegalStateException: An enum field must have its enum entity name set
	at org.blackdread.sqltojava.util.JdlUtils.lambda$writeField$0( ~[classes/:na]
	at java.util.Optional.orElseThrow( ~[na:1.8.0_171]
	at org.blackdread.sqltojava.util.JdlUtils.writeField( ~[classes/:na]
	at org.blackdread.sqltojava.util.JdlUtils.writeEntity( ~[classes/:na]
	at org.blackdread.sqltojava.service.logic.ExportService.export( ~[classes/:na]
	at [classes/:na]
	at org.springframework.boot.SpringApplication.callRunner( [spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]
	... 10 common frames omitted

Do not recognize the ENUM column type ?, or it needs an specific treatment ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

octgsoftwarecommented, Dec 4, 2022

I already have a test that covers native enum for both Postgres and MySQL. This can be closed.

Blackdreadcommented, Nov 30, 2022

I do not remember what else was done but I think we can check the different test cases you added and have an enum type in DB then see result

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mysql enum field problems - Stack Overflow
1 Answer 1 ... From the Empty or NULL Enumeration Values documentation: If you insert an invalid value into an ENUM (that is,...
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 >
SQL error when updating columns with ENUMs type and a ...
Step 2: I'm going into the structure tab of this table and changing the enum's 'type' column image. Step 3: Error on save...
Read more >
MySQL Enum Data Truncated for Column: Solution - Bobcares
MySQL enum data truncated for column refers to an error. The issue arises when the column status is of the type enum.
Read more >
A Comprehensive Guide to Using MySQL ENUM Data Type
This tutorial introduces you to MySQL ENUM data type and shows you how to define ENUM columns for storing enumeration values.
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 Post

No results found

github_iconTop Related Hashnode Post

No results found