-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: org.hibernate.exception.SQLGrammarException
PostPosted: Wed Nov 02, 2011 3:46 am 
Newbie

Joined: Wed Nov 02, 2011 12:11 am
Posts: 2
Hi, I am new to hibernate. I am trying to save an object into the database and it throws this exception.

Could anyone help me out.

Thanks in advance.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="hibernate.connection.password">04j81a0516</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/bugtracking</property>
        <property name="hibernate.connection.username">root</property>
        <property name="hibernate.default_schema">bugtracking</property>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
          <mapping resource="com/bugtracking/model/Bug.hbm.xml"/>
        <mapping resource="com/bugtracking/model/Operatingsystem.hbm.xml"/>
        <mapping resource="com/bugtracking/model/Project.hbm.xml"/>
        <mapping resource="com/bugtracking/model/Role.hbm.xml"/>
        <mapping resource="com/bugtracking/model/Severity.hbm.xml"/>
        <mapping resource="com/bugtracking/model/Status.hbm.xml"/>
        <mapping resource="com/bugtracking/model/Task.hbm.xml"/>
        <mapping resource="com/bugtracking/model/TaskType.hbm.xml"/>
        <mapping resource="com/bugtracking/model/User.hbm.xml"/>
    </session-factory>
</hibernate-configuration>


Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Oct 31, 2011 5:15:12 PM by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
    <class name="com.bugtracking.model.Operatingsystem" table="operatingsystem" catalog="bugtracking">
        <id name="id" type="java.lang.Integer">
            <column name="Id" />
            <generator class="identity" />
        </id>
        <property name="operatingSystemName" type="string">
            <column name="OperatingSystemName" length="45" not-null="true" />
        </property>
        <property name="osdescription" type="string">
            <column name="OSDescription" length="100" />
        </property>
        <set name="bugs" table="bug" inverse="true" lazy="true" fetch="select">
            <key>
                <column name="OS" not-null="true" />
            </key>
            <one-to-many class="com.bugtracking.model.Bug" />
        </set>
    </class>
</hibernate-mapping>


Code:
package com.bugtracking.model;

// default package
// Generated Oct 31, 2011 5:15:12 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;

/**
* Operatingsystem generated by hbm2java
*/
public class Operatingsystem implements java.io.Serializable {

   private Integer id;
   private String operatingSystemName;
   private String osdescription;
   private Set<Bug> bugs = new HashSet<Bug>(0);

   public Operatingsystem() {
   }

   public Operatingsystem(String operatingSystemName) {
      this.operatingSystemName = operatingSystemName;
   }

   public Operatingsystem(String operatingSystemName, String osdescription,
         Set<Bug> bugs) {
      this.operatingSystemName = operatingSystemName;
      this.osdescription = osdescription;
      this.bugs = bugs;
   }

   public Integer getId() {
      return this.id;
   }

   public void setId(Integer id) {
      this.id = id;
   }

   public String getOperatingSystemName() {
      return this.operatingSystemName;
   }

   public void setOperatingSystemName(String operatingSystemName) {
      this.operatingSystemName = operatingSystemName;
   }

   public String getOsdescription() {
      return this.osdescription;
   }

   public void setOsdescription(String osdescription) {
      this.osdescription = osdescription;
   }

   public Set<Bug> getBugs() {
      return this.bugs;
   }

   public void setBugs(Set<Bug> bugs) {
      this.bugs = bugs;
   }

}



Code:
package com.bugtracking.test;

import org.hibernate.*;
import org.hibernate.cfg.*;

import com.bugtracking.model.*;

public class CreateTest {

   /**
    * @param args
    */
   public static void main(String[] args) {
      // TODO Auto-generated method stub
      Configuration config = new Configuration();
      config.configure();
      
      SessionFactory sessionFactory = config.buildSessionFactory();
      Session session = sessionFactory.openSession();
      
      Transaction tx = null;
      
      Operatingsystem os = new Operatingsystem("Windows Server 2003", "Win Server 2003 entry",null);
      
      try{
         tx = session.beginTransaction();
         
         session.save(os);
         
         tx.commit();
         
      }catch(Exception ex){
         if(tx!=null)
         {
            tx.rollback();
         }
         ex.printStackTrace();
      }finally{
         session.close();
         sessionFactory.close();
      }

   }
}



11654 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1064, SQLState: 42000
11654 [main] ERROR org.hibernate.util.JDBCExceptionReporter - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.operatingsystem (OperatingSystemName, OSDescription) values ('Windows Server 20' at line 1
org.hibernate.exception.SQLGrammarException: could not insert: [com.bugtracking.model.Operatingsystem]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2345)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2852)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:713)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:701)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:697)
at com.bugtracking.test.CreateTest.main(CreateTest.java:28)
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.operatingsystem (OperatingSystemName, OSDescription) values ('Windows Server 20' at line 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
... 16 more


Top
 Profile  
 
 Post subject: Re: org.hibernate.exception.SQLGrammarException
PostPosted: Wed Nov 02, 2011 5:53 am 
Newbie

Joined: Wed Nov 02, 2011 4:53 am
Posts: 2
Location: Belgium
Hi,

Can you add this to your Hibernate configuration file? It will give you more information about the SQL statement:

<property name="hibernate.show_sql">true</property>

Greetings


Top
 Profile  
 
 Post subject: Re: org.hibernate.exception.SQLGrammarException
PostPosted: Wed Nov 02, 2011 6:06 am 
Newbie

Joined: Wed Nov 02, 2011 12:11 am
Posts: 2
after i enabled show_sql to true i got the below output

and after seeing the sql...i removed the entry

Code:
<property name="hibernate.default_schema">bugtracking</property>


now it is working fine... :) :D

thanks for the suggestion.

256 [main] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
270 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.6.8.Final
273 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
280 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
288 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
424 [main] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
425 [main] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
545 [main] WARN org.hibernate.util.DTDEntityResolver - recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
587 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : com/bugtracking/model/Bug.hbm.xml
639 [main] WARN org.hibernate.util.DTDEntityResolver - recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
729 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : com/bugtracking/model/Operatingsystem.hbm.xml
735 [main] WARN org.hibernate.util.DTDEntityResolver - recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
810 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : com/bugtracking/model/Project.hbm.xml
815 [main] WARN org.hibernate.util.DTDEntityResolver - recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
873 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : com/bugtracking/model/Role.hbm.xml
879 [main] WARN org.hibernate.util.DTDEntityResolver - recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
959 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : com/bugtracking/model/Severity.hbm.xml
964 [main] WARN org.hibernate.util.DTDEntityResolver - recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
997 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : com/bugtracking/model/Status.hbm.xml
1004 [main] WARN org.hibernate.util.DTDEntityResolver - recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
1067 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : com/bugtracking/model/Task.hbm.xml
1072 [main] WARN org.hibernate.util.DTDEntityResolver - recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
1476 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : com/bugtracking/model/TaskType.hbm.xml
1496 [main] WARN org.hibernate.util.DTDEntityResolver - recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
1553 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : com/bugtracking/model/User.hbm.xml
1558 [main] WARN org.hibernate.util.DTDEntityResolver - recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
1884 [main] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
1978 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.bugtracking.model.Bug -> bug
2023 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.bugtracking.model.Operatingsystem -> operatingsystem
2024 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.bugtracking.model.Project -> project
2026 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.bugtracking.model.Role -> role
2026 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.bugtracking.model.Severity -> severity
2028 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.bugtracking.model.Status -> status
2029 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.bugtracking.model.Task -> task
2030 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.bugtracking.model.Tasktype -> tasktype
2034 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: com.bugtracking.model.User -> user
2050 [main] INFO org.hibernate.cfg.HbmBinder - Mapping collection: com.bugtracking.model.Bug.tasks -> task
2051 [main] INFO org.hibernate.cfg.HbmBinder - Mapping collection: com.bugtracking.model.Operatingsystem.bugs -> bug
2051 [main] INFO org.hibernate.cfg.HbmBinder - Mapping collection: com.bugtracking.model.Project.bugs -> bug
2052 [main] INFO org.hibernate.cfg.HbmBinder - Mapping collection: com.bugtracking.model.Project.projects -> project
2052 [main] INFO org.hibernate.cfg.HbmBinder - Mapping collection: com.bugtracking.model.Role.users -> user
2052 [main] INFO org.hibernate.cfg.HbmBinder - Mapping collection: com.bugtracking.model.Severity.bugs -> bug
2052 [main] INFO org.hibernate.cfg.HbmBinder - Mapping collection: com.bugtracking.model.Status.bugs -> bug
2052 [main] INFO org.hibernate.cfg.HbmBinder - Mapping collection: com.bugtracking.model.Status.tasks -> task
2053 [main] INFO org.hibernate.cfg.HbmBinder - Mapping collection: com.bugtracking.model.Tasktype.tasks -> task
2053 [main] INFO org.hibernate.cfg.HbmBinder - Mapping collection: com.bugtracking.model.User.tasks -> task
2053 [main] INFO org.hibernate.cfg.HbmBinder - Mapping collection: com.bugtracking.model.User.bugs -> bug
2053 [main] INFO org.hibernate.cfg.HbmBinder - Mapping collection: com.bugtracking.model.User.projects -> project
2064 [main] INFO org.hibernate.cfg.Configuration - Hibernate Validator not found: ignoring
2073 [main] INFO org.hibernate.cfg.search.HibernateSearchEventListenerRegister - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
2085 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
2085 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20
2085 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
2096 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/bugtracking
2096 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=root, password=****}
4978 [main] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQLDialect
4998 [main] INFO org.hibernate.engine.jdbc.JdbcSupportLoader - Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
4999 [main] INFO org.hibernate.cfg.SettingsFactory - Database ->
name : MySQL
version : 5.5.15
major : 5
minor : 5
4999 [main] INFO org.hibernate.cfg.SettingsFactory - Driver ->
name : MySQL-AB JDBC Driver
version : mysql-connector-java-5.0.8 ( Revision: ${svn.Revision} )
major : 5
minor : 0
5001 [main] INFO org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
5005 [main] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
5005 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
5005 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
5005 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
5005 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
5006 [main] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
5006 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled
5006 [main] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
5008 [main] INFO org.hibernate.cfg.SettingsFactory - Default schema: bugtracking
5008 [main] INFO org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2
5008 [main] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
5008 [main] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
5008 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
5008 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
5008 [main] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
5012 [main] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
5012 [main] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
5012 [main] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
5012 [main] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
5013 [main] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
5013 [main] INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
5016 [main] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
5016 [main] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
5026 [main] INFO org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
5027 [main] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
5028 [main] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
5028 [main] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
5028 [main] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled
5028 [main] INFO org.hibernate.cfg.SettingsFactory - Check Nullability in Core (should be disabled when Bean Validation is on): enabled
5093 [main] INFO org.hibernate.impl.SessionFactoryImpl - building session factory
5105 [main] INFO org.hibernate.type.BasicTypeRegistry - Type registration [materialized_blob] overrides previous : org.hibernate.type.MaterializedBlobType@3801318b
5105 [main] INFO org.hibernate.type.BasicTypeRegistry - Type registration [clob] overrides previous : org.hibernate.type.ClobType@565bb966
5106 [main] INFO org.hibernate.type.BasicTypeRegistry - Type registration [java.sql.Clob] overrides previous : org.hibernate.type.ClobType@565bb966
5106 [main] INFO org.hibernate.type.BasicTypeRegistry - Type registration [wrapper_characters_clob] overrides previous : org.hibernate.type.CharacterArrayClobType@1fe903d5
5106 [main] INFO org.hibernate.type.BasicTypeRegistry - Type registration [wrapper_materialized_blob] overrides previous : org.hibernate.type.WrappedMaterializedBlobType@7afaa550
5106 [main] INFO org.hibernate.type.BasicTypeRegistry - Type registration [materialized_clob] overrides previous : org.hibernate.type.MaterializedClobType@5d7b6643
5106 [main] INFO org.hibernate.type.BasicTypeRegistry - Type registration [blob] overrides previous : org.hibernate.type.BlobType@5076e8a7
5106 [main] INFO org.hibernate.type.BasicTypeRegistry - Type registration [java.sql.Blob] overrides previous : org.hibernate.type.BlobType@5076e8a7
5106 [main] INFO org.hibernate.type.BasicTypeRegistry - Type registration [characters_clob] overrides previous : org.hibernate.type.PrimitiveCharacterArrayClobType@2ea45536
5682 [main] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
Hibernate: insert into bugtracking.bugtracking.operatingsystem (OperatingSystemName, OSDescription) values (?, ?)
5830 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1064, SQLState: 42000
5830 [main] ERROR org.hibernate.util.JDBCExceptionReporter - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.operatingsystem (OperatingSystemName, OSDescription) values ('Windows Server 20' at line 1
org.hibernate.exception.SQLGrammarException: could not insert: [com.bugtracking.model.Operatingsystem]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2345)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2852)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:713)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:701)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:697)
at com.bugtracking.test.CreateTest.main(CreateTest.java:28)
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.operatingsystem (OperatingSystemName, OSDescription) values ('Windows Server 20' at line 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
... 16 more
5835 [main] INFO org.hibernate.impl.SessionFactoryImpl - closing
5835 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - cleaning up connection pool: jdbc:mysql://localhost:3306/bugtracking


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.