Member-only story
Spring Boot JPA @Entity “invalid identifier” java.sql.SQLException Error
So, I was creating a RESTful service with Spring Boot + Oracle DB, and I got the following error when I visited a REST url that I put in to a @RestController
2015–08–12 11:31:27.470 ERROR 9676 — [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet] with root cause
java.sql.SQLException: ORA-00904: “CASPRODUCT0_”.”PATH_IMG_THUMB”: invalid identifier
Here is my domain class:
import
javax.persistence.Column;
import
javax.persistence.Entity;
import
javax.persistence.GeneratedValue;
import
javax.persistence.Id;
import
javax.persistence.Table;
import
org.springframework.data.annotation.Transient;
@Entity
@Table(name="casproduct")
public
class
CasProduct {</code>
@Id
@Column(name="id", unique=true, nullable=false)
@GeneratedValue