Witam,
tak jak w temacie mam problem z tworzeniem nowego obiektu w javie danych, przy probie wywolania perista leci mi:
SEVERE: Servlet.service() for servlet [DispatcherServlet] in context with path [/webstore] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute statement] with root cause
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'condition, description, discontinued, manufacturer, name, unitPrice, unitsInOrde' at line 1
ProductData
@Entity
@Table(name = "Product")
public class ProductData {
@Id
@Column(name = "id")
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Integer id;
@Column(name = "code")
private String code;
@Column(name = "name")
private String name;
@Column(name = "unitPrice")
private Integer unitPrice;
@Column(name = "description")
private String description;
@Column(name = "manufacturer")
private String manufacturer;
@Column(name = "category")
private String category;
@Column(name = "unitsInStock")
private long unitsInStock;
@Column(name = "unitsInOrder")
private long unitsInOrder;
@Column(name = "discontinued")
private boolean discontinued;
@Column(name = "condition")
private String condition;
Konfiguracja hibernate:
Properties additionalProperties() {
Properties properties = new Properties();
properties.setProperty("hibernate.id.new_generator_mappings", "false");
properties.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQL5Dialect");
return properties;
}