buenas tardes
en el momento de crear las tablas y relacionarlas me arroja este error oct. 03, 2023 10:42:54 A. M. org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl handleException WARN: GenerationTarget encountered exception accepting command : Error executing DDL " alter table ittems producto add constraint FKnjigfnx19vt0vaijxkwt8r56g foreign key (produtos_id) references productos" via JDBC Statement org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL " alter table ittems producto add constraint FKnjigfnx19vt0vaijxkwt8r56g foreign key (produtos_id) references productos" via JDBC Statement at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlString(SchemaCreatorImpl.java:458) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlStrings(SchemaCreatorImpl.java:442) at com.alura.latam.tienda.utils.JPAUtils.(JPAUtils.java:9) at com.alura.latam.tienda.pruebas.RegistroPorducto.regitroDelProduxto(RegistroPorducto.java:90) at com.alura.latam.tienda.pruebas.RegistroPorducto.main(RegistroPorducto.java:64) Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Error de Sintaxis en sentencia SQL "\000d\000a alter table ittems []producto \000d\000a add constraint FKnjigfnx19vt0vaijxkwt8r56g \000d\000a foreign key (produtos_id) \000d\000a references productos"; se esperaba "., ADD, SET, RENAME, DROP, ALTER" Syntax error in SQL statement "\000d\000a alter table ittems []producto \000d\000a add constraint FKnjigfnx19vt0vaijxkwt8r56g \000d\000a foreign key (produtos_id) \000d\000a references productos"; expected "., ADD, SET, RENAME, DROP, ALTER"; SQL statement:
alter table ittems producto
add constraint FKnjigfnx19vt0vaijxkwt8r56g
foreign key (produtos_id)
references productos [42001-214]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:502)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:477)
at org.h2.message.DbException.getSyntaxError(DbException.java:261)
at org.h2.command.Parser.getSyntaxError(Parser.java:900)
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:223)
at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54)
... 17 more
Hibernate:
alter table ittems producto
add constraint FKh2edadxrh0xp9kwt4h96chxr7
foreign key (Pedido_id)
references pedidos
oct. 03, 2023 10:42:54 A. M. org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl handleException WARN: GenerationTarget encountered exception accepting command : Error executing DDL " alter table ittems producto add constraint FKh2edadxrh0xp9kwt4h96chxr7 foreign key (Pedido_id) references pedidos" via JDBC Statement org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL " alter table ittems producto add constraint FKh2edadxrh0xp9kwt4h96chxr7 foreign key (Pedido_id) references pedidos" via JDBC Statement at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) at com.alura.latam.tienda.pruebas.RegistroPorducto.regitroDelProduxto(RegistroPorducto.java:90) at com.alura.latam.tienda.pruebas.RegistroPorducto.main(RegistroPorducto.java:64) Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Error de Sintaxis en sentencia SQL "\000d\000a alter table ittems []producto \000d\000a add constraint FKh2edadxrh0xp9kwt4h96chxr7 \000d\000a foreign key (Pedido_id) \000d\000a references pedidos"; se esperaba "., ADD, SET, RENAME, DROP, ALTER" Syntax error in SQL statement "\000d\000a alter table ittems []producto \000d\000a add constraint FKh2edadxrh0xp9kwt4h96chxr7 \000d\000a foreign key (Pedido_id) \000d\000a references pedidos"; expected "., ADD, SET, RENAME, DROP, ALTER"; SQL statement:
alter table ittems producto
add constraint FKh2edadxrh0xp9kwt4h96chxr7
foreign key (Pedido_id)
refere
nose como lopueda solucionar