I have created a spring boot application with spring data JPA, Rest ,oracle and i am getting this ORA-00933: SQL command not properly ended

17 views Asked by At

-- Product class---

@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE )
@Column (name ="id")
private Long id;

@Column(name ="sku")
private String sku;

@Column(name ="name")
private String name;

@Column(name ="description")
private String description;

@Column(name ="unit_price")
private BigDecimal unitPrice;

@Column(name ="image_url")
private String imageUrl;

@Column(name ="active")
private boolean active;

@Column(name ="units_in_stock")
private int unitsInStock;

@Column(name ="date_created")
@CreationTimestamp
private Date dateCreated;

@Column(name ="last_updated")
@UpdateTimestamp
private Date lastUpdated;

@ManyToOne(
        cascade = CascadeType.ALL
)
@JoinColumn(name = "category_id", nullable = false)
private ProductCategory category;

}

--- ProductRepository.java------

Extended JpaRepository.

------application.properties------

spring.application.name=ecommerce-app

spring.data.rest.base-path=/api

-------------here is my error when accessing http://localhost:8081/api/products-----

Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.dao.InvalidDataAccessResourceUsageException: JDBC exception executing SQL [select p1_0.id,p1_0.active,p1_0.category_id,p1_0.date_created,p1_0.description,p1_0.image_url,p1_0.last_updated,p1_0.name,p1_0.sku,p1_0.unit_price,p1_0.units_in_stock from product p1_0 offset ? rows fetch first ? rows only] [ORA-00933: SQL command not properly ended ] [n/a]; SQL [n/a]] with root cause

oracle.jdbc.OracleDatabaseException: ORA-00933: SQL command not properly ended

i have created test class for product to use findAll() , yes thats working fine but its erroring out when accessing with rest api urls.

0

There are 0 answers