org.hibernate.tool.schema.spi.CommandAcceptanceException: Unable to execute command [ create table UUID_ID_ENTITY ( id binary not null, primary key (id) )]

Hibernate JIRA | Vlad Mihalcea | 7 months ago
  1. 0

    Oracle does not have a BINARY type. Instead,it has [a RAW type|https://docs.oracle.com/cd/B28359_01/server.111/b28286/sql_elements001.htm]. When running the {{UUIDBasedIdInterpretationTest}} on Oracle: {noformat} gradle clean test -Pdb=oracle {noformat} We get the following error: {noformat} org.hibernate.tool.schema.spi.CommandAcceptanceException: Unable to execute command [ create table UUID_ID_ENTITY ( id binary not null, primary key (id) )] at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:63) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlString(SchemaCreatorImpl.java:434) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlStrings(SchemaCreatorImpl.java:419) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.createFromMetadata(SchemaCreatorImpl.java:310) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.performCreation(SchemaCreatorImpl.java:165) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:134) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:120) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:148) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:64) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:458) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:465) at org.hibernate.boot.internal.MetadataImpl.buildSessionFactory(MetadataImpl.java:170) at org.hibernate.test.id.uuid.interpretation.UUIDBasedIdInterpretationTest.testBinaryRuntimeUsage(UUIDBasedIdInterpretationTest.java:109) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:45) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74) Caused by: java.sql.SQLSyntaxErrorException: ORA-00902: invalid datatype {noformat}

    Hibernate JIRA | 7 months ago | Vlad Mihalcea
    org.hibernate.tool.schema.spi.CommandAcceptanceException: Unable to execute command [ create table UUID_ID_ENTITY ( id binary not null, primary key (id) )]
  2. 0

    Oracle does not have a BINARY type. Instead,it has [a RAW type|https://docs.oracle.com/cd/B28359_01/server.111/b28286/sql_elements001.htm]. When running the {{UUIDBasedIdInterpretationTest}} on Oracle: {noformat} gradle clean test -Pdb=oracle {noformat} We get the following error: {noformat} org.hibernate.tool.schema.spi.CommandAcceptanceException: Unable to execute command [ create table UUID_ID_ENTITY ( id binary not null, primary key (id) )] at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:63) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlString(SchemaCreatorImpl.java:434) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlStrings(SchemaCreatorImpl.java:419) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.createFromMetadata(SchemaCreatorImpl.java:310) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.performCreation(SchemaCreatorImpl.java:165) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:134) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:120) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:148) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:64) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:458) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:465) at org.hibernate.boot.internal.MetadataImpl.buildSessionFactory(MetadataImpl.java:170) at org.hibernate.test.id.uuid.interpretation.UUIDBasedIdInterpretationTest.testBinaryRuntimeUsage(UUIDBasedIdInterpretationTest.java:109) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:45) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74) Caused by: java.sql.SQLSyntaxErrorException: ORA-00902: invalid datatype {noformat}

    Hibernate JIRA | 7 months ago | Vlad Mihalcea
    org.hibernate.tool.schema.spi.CommandAcceptanceException: Unable to execute command [ create table UUID_ID_ENTITY ( id binary not null, primary key (id) )]
  3. 0

    When running the {{org.hibernate.userguide.mapping.basic.NationalizedTest}} using PostgreSQL, we get the following exception: {noformat} org.hibernate.tool.schema.spi.CommandAcceptanceException: Unable to execute command [ create table Product ( id int4 not null, name varchar(255), warranty nvarchar(255), primary key (id) )] at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:63) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlString(SchemaCreatorImpl.java:434) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlStrings(SchemaCreatorImpl.java:419) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.createFromMetadata(SchemaCreatorImpl.java:310) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.performCreation(SchemaCreatorImpl.java:165) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:134) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:120) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:148) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:64) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:458) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:465) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:881) at org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase.buildEntityManagerFactory(BaseEntityManagerFunctionalTestCase.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74) Caused by: org.postgresql.util.PSQLException: ERROR: type "nvarchar" does not exist {noformat} Second, the PostgreSQL driver does not support {{Statement.setNVarChar}} either, and so we cannot use the {{NVarcharTypeDescriptor}} for PostgreSQL. {noformat} Caused by: java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc4.Jdbc4PreparedStatement.setNString(int, String) is not yet implemented. at org.postgresql.Driver.notImplemented(Driver.java:670) at org.postgresql.jdbc4.AbstractJdbc4Statement.setNString(AbstractJdbc4Statement.java:101) at org.hibernate.type.descriptor.sql.NVarcharTypeDescriptor$1.doBind(NVarcharTypeDescriptor.java:46) {noformat} Accodring to this [site|http://www.sqlines.com/sql-server-to-postgresql] and this [SO question|http://stackoverflow.com/questions/21925802/can-i-able-to-use-nvarchar-data-type-in-plpgsql], The PostgreSQL VARCHAR plays the role of an NVARCHAR in other DBs,

    Hibernate JIRA | 8 months ago | Vlad Mihalcea
    org.hibernate.tool.schema.spi.CommandAcceptanceException: Unable to execute command [ create table Product ( id int4 not null, name varchar(255), warranty nvarchar(255), primary key (id) )]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    When running the {{org.hibernate.userguide.mapping.basic.NationalizedTest}} using PostgreSQL, we get the following exception: {noformat} org.hibernate.tool.schema.spi.CommandAcceptanceException: Unable to execute command [ create table Product ( id int4 not null, name varchar(255), warranty nvarchar(255), primary key (id) )] at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:63) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlString(SchemaCreatorImpl.java:434) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlStrings(SchemaCreatorImpl.java:419) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.createFromMetadata(SchemaCreatorImpl.java:310) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.performCreation(SchemaCreatorImpl.java:165) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:134) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:120) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:148) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:64) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:458) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:465) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:881) at org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase.buildEntityManagerFactory(BaseEntityManagerFunctionalTestCase.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74) Caused by: org.postgresql.util.PSQLException: ERROR: type "nvarchar" does not exist {noformat} Second, the PostgreSQL driver does not support {{Statement.setNVarChar}} either, and so we cannot use the {{NVarcharTypeDescriptor}} for PostgreSQL. {noformat} Caused by: java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc4.Jdbc4PreparedStatement.setNString(int, String) is not yet implemented. at org.postgresql.Driver.notImplemented(Driver.java:670) at org.postgresql.jdbc4.AbstractJdbc4Statement.setNString(AbstractJdbc4Statement.java:101) at org.hibernate.type.descriptor.sql.NVarcharTypeDescriptor$1.doBind(NVarcharTypeDescriptor.java:46) {noformat} Accodring to this [site|http://www.sqlines.com/sql-server-to-postgresql] and this [SO question|http://stackoverflow.com/questions/21925802/can-i-able-to-use-nvarchar-data-type-in-plpgsql], The PostgreSQL VARCHAR plays the role of an NVARCHAR in other DBs,

    Hibernate JIRA | 8 months ago | Vlad Mihalcea
    org.hibernate.tool.schema.spi.CommandAcceptanceException: Unable to execute command [ create table Product ( id int4 not null, name varchar(255), warranty nvarchar(255), primary key (id) )]
  6. 0

    Table doesn't exist:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException

    Stack Overflow | 7 months ago | FuSsA
    org.hibernate.tool.schema.spi.CommandAcceptanceException: Unable to execute command [ alter table QWE drop foreign key FK5f4s5qg3vma47jthit51i7wvy]

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.tool.schema.spi.CommandAcceptanceException

      Unable to execute command [ create table UUID_ID_ENTITY ( id binary not null, primary key (id) )]

      at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept()
    2. org.hibernate.tool
      SchemaManagementToolCoordinator.process
      1. org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:63)
      2. org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlString(SchemaCreatorImpl.java:434)
      3. org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlStrings(SchemaCreatorImpl.java:419)
      4. org.hibernate.tool.schema.internal.SchemaCreatorImpl.createFromMetadata(SchemaCreatorImpl.java:310)
      5. org.hibernate.tool.schema.internal.SchemaCreatorImpl.performCreation(SchemaCreatorImpl.java:165)
      6. org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:134)
      7. org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:120)
      8. org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:148)
      9. org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:64)
      9 frames
    3. Hibernate
      SessionFactoryImpl.<init>
      1. org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:458)
      1 frame
    4. org.hibernate.boot
      MetadataImpl.buildSessionFactory
      1. org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:465)
      2. org.hibernate.boot.internal.MetadataImpl.buildSessionFactory(MetadataImpl.java:170)
      2 frames
    5. org.hibernate.test
      UUIDBasedIdInterpretationTest.testBinaryRuntimeUsage
      1. org.hibernate.test.id.uuid.interpretation.UUIDBasedIdInterpretationTest.testBinaryRuntimeUsage(UUIDBasedIdInterpretationTest.java:109)
      1 frame
    6. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    7. JUnit
      FrameworkMethod.invokeExplosively
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      3 frames
    8. A Hibernate O/RM Module
      ExtendedFrameworkMethod.invokeExplosively
      1. org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:45)
      1 frame
    9. JUnit
      FailOnTimeout$StatementThread.run
      1. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      2. org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      3. org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)
      3 frames