org.hibernate.exception.SQLGrammarException: could not execute query

Hibernate JIRA | Darren Bell | 1 decade ago
  1. 0

    @Column annotations on a getters within an @Embeddable object are getting ignored. The embeddable is seen but the generated sql is using the properties and not the column name. Below is the code. ------------------------------------------------------------------------ package com.dolby.pics.core.db.model.impl; import java.util.HashSet; import java.util.Set; import javax.persistence.Column; import javax.persistence.Embedded; import javax.persistence.Entity; import javax.persistence.GeneratorType; import javax.persistence.Id; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Table; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; import com.dolby.pics.core.db.model.IBusinessUnit; import com.dolby.pics.core.db.util.EntityObject; import com.dolby.pics.core.db.util.ILifecycle; /** * @author <a href="mailto:djb@dolby.co.uk">Darren Bell</a> - Dolby Laboratories Inc. * Data class for Business Units */ @Entity @Table(name="BUSINESS_UNIT", schema="ZCOREINV") @NamedQueries({ @NamedQuery( name="query.BusinessUnit.single.byName", queryString="from BusinessUnit bu where bu.name = :name"), @NamedQuery( name="query.BusinessUnit.all", queryString="from BusinessUnit bu") }) public class BusinessUnit extends EntityObject implements IBusinessUnit { /** * */ private static final long serialVersionUID = 4120848867379065142L; /** query to return a business unit by name */ public static final String QUERY_BY_NAME = "query.BusinessUnit.single.byName"; //$NON-NLS-1$ /** query to return all business units */ public static final String QUERY_ALL = "query.BusinessUnit.all"; //$NON-NLS-1$ /** name attribute */ public static final String ATTR_NAME = "name"; //$NON-NLS-1$ private String fName; private String fDescription; /** The lifecycle for this entity */ protected ILifecycle fLifecycle; /** * default cons */ BusinessUnit() { super(); } /** * Creates a new business unit with the given name * @param name The name for this business unit */ public BusinessUnit(final String name) { this(name, null); } /** * Creates a business unit with the provided name and description * @param name Name of business unit * @param desc Business unit description */ public BusinessUnit(final String name, final String desc) { super(); setName(name); setDescription(desc); } /** * Returns the description for this business unit * @return Returns the description. */ @Column(name="BU_DESCRIPTION", length=128, nullable=false) public String getDescription() { return fDescription; } /** * Sets the description for this business unit * @param description The description to set. */ public void setDescription(final String description) { fDescription = description; } /** * Gets the name of this business unit * @return Returns the name. * @hibernate.id * unsaved-value="null" * generator-class="assigned" * column="BU_NAME" * type="string" * length="5" */ @Id(generate=GeneratorType.NONE) @Column(name="BU_NAME") public String getName() { return fName; } /** * Sets the name for this business unit * @param name The name to set. */ private void setName(final String name) { fName = name; } /** * Return a string rpresentation of this business unit * @see java.lang.Object#toString() */ public String toString() { return getName(); } /** * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(final Object obj) { // do NOT use instanceof! if (obj != null && getClass() == obj.getClass()) { //BusinessUnit rhs = (BusinessUnit) obj; return new EqualsBuilder() .append(getName(), ((IBusinessUnit) obj).getName()) .isEquals(); } return false; } /** * @see java.lang.Object#hashCode() */ public int hashCode() { return new HashCodeBuilder(17, 37) .append(getName()) .toHashCode(); } /** * Sets the new lifecycle for this entity * @param lifecycle The new lifecycle */ protected void setLifecycle(final ILifecycle lifecycle) { fLifecycle = lifecycle; } /** * Gets the lifecycle object for this entity * @see com.dolby.pics.core.db.system.IEntityLifecycle#getLifecycle() * @return This entitys lifecycle */ @Embedded public final ILifecycle getLifecycle() { return fLifecycle; } } -------------------------------------------------------------------- /* Copyright 2005 Dolby Laboratories Inc. All rights reserved. * See license distributed with this file or available at * http://ukdev/license.html */ package com.dolby.pics.core.db.util; import java.io.Serializable; import java.sql.Timestamp; import javax.persistence.AccessType; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Embeddable; import javax.persistence.Transient; /** * @author <a href="mailto:djb@dolby.co.uk">Darren Bell</a> - Dolby Laboratories Inc. */ @Embeddable public class Lifecycle implements ILifecycle, Cloneable, Serializable { /** * */ private static final long serialVersionUID = 3257565113824588089L; /** User who created this entity object */ private String fCreatedByUser; /** The system that is creating/created this object */ private String fCreatedBySystem; /** The date/time that this object was created */ private Timestamp fCreatedTimestamp; /** the user who is updating/updated this object */ private String fUpdatedByUser; /** the system that is updating/updated this object */ private String fUpdatedBySystem; /** the date/time that this object is being/was updated */ private Timestamp fUpdatedTimestamp; /** * Creates a new lifecycle object */ Lifecycle() { super(); } /** * @see com.dolby.pics.core.db.system.ILifecycle#getCreatedByUser() */ @Column(name="CREATED_BY_USER", nullable=false, length=32, columnDefinition="varchar(32)", updatable=false) public String getCreatedByUser() { return fCreatedByUser; } /** * @see com.dolby.pics.core.db.system.ILifecycle#getCreatedBySystem() */ @Column(name="CREATED_BY_SYSTEM", nullable=false, length=32, updatable=false) public String getCreatedBySystem() { return fCreatedBySystem; } /** * @see com.dolby.pics.core.db.system.ILifecycle#getCreatedTimestamp() * @return the timestamp when the object was created */ @Column(name="CREATED_TIMESTAMP", nullable=false, updatable=false) public Timestamp getCreatedTimestamp() { return fCreatedTimestamp; } /** * @see com.dolby.pics.core.db.system.ILifecycle#setCreatedByUser(java.lang.String) */ public void setCreatedByUser(final String createByUser) { fCreatedByUser = createByUser; } /** * @see com.dolby.pics.core.db.system.ILifecycle#setCreatedBySystem(java.lang.String) */ public void setCreatedBySystem(final String createdBySystem) { fCreatedBySystem = createdBySystem; } /** * @see com.dolby.pics.core.db.system.ILifecycle#setCreatedTimestamp(java.sql.Timestamp) */ public void setCreatedTimestamp(final Timestamp createdTimestamp) { fCreatedTimestamp = createdTimestamp; } /** * @see com.dolby.pics.core.db.system.ILifecycle#getUpdatedByUser() */ @Column(name="UPDATED_BY_USER", length=32, insertable=false) public String getUpdatedByUser() { return fUpdatedByUser; } /** * @return the system that updated this object */ @Column(name="UPDATED_BY_SYSTEM", length=32, insertable=false) public String getUpdatedBySystem() { return fUpdatedBySystem; } /** * @return The time and date this entity was changed * @see com.dolby.pics.core.db.system.ILifecycle#getUpdatedTimestamp() */ @Column(name="UPDATED_TIMESTAMP", insertable=false) public Timestamp getUpdatedTimestamp() { return fUpdatedTimestamp; } /** * @param updatedByUser * @see com.dolby.pics.core.db.system.ILifecycle#setUpdatedByUser(java.lang.String) */ public void setUpdatedByUser(final String updatedByUser) { fUpdatedByUser = updatedByUser; } /** * @param updatedBySystem * @see com.dolby.pics.core.db.system.ILifecycle#setUpdatedBySystem(java.lang.String) */ public void setUpdatedBySystem(final String updatedBySystem) { fUpdatedBySystem = updatedBySystem; } /** * @see com.dolby.pics.core.db.system.ILifecycle#setUpdatedTimestamp(java.sql.Timestamp) */ public void setUpdatedTimestamp(final Timestamp updatedTimestamp) { fUpdatedTimestamp = updatedTimestamp; } /** * @see java.lang.Object#clone() */ protected Object clone() throws CloneNotSupportedException { Lifecycle clonedLifecycle = new Lifecycle(); clonedLifecycle.setCreatedBySystem(getCreatedBySystem()); clonedLifecycle.setCreatedByUser(getCreatedByUser()); clonedLifecycle.setCreatedTimestamp(getCreatedTimestamp()); clonedLifecycle.setUpdatedBySystem(getUpdatedBySystem()); clonedLifecycle.setUpdatedByUser(getUpdatedByUser()); clonedLifecycle.setUpdatedTimestamp(getUpdatedTimestamp()); return clonedLifecycle; } /** * Return a formatted string for this lifecycle * @see java.lang.Object#toString() */ public String toString() { //String TO_STRING = "[CREATED: by-{0}, @-{1}, in-{2}; UPDATED: by-{3}, @-{4}, in-{5}]"; //$NON-NLS-1$ return "[CREATED: by-" //$NON-NLS-1$ + getCreatedByUser() + ", @-" //$NON-NLS-1$ + getCreatedTimestamp() + ", in-" //$NON-NLS-1$ + getCreatedBySystem() + "; UPDATED: " //$NON-NLS-1$ + getUpdatedByUser() + ", @-" //$NON-NLS-1$ + getUpdatedTimestamp() + ", in-" //$NON-NLS-1$ + getUpdatedBySystem() + "]"; //$NON-NLS-1$ } } --------------------------------------------------------------------- Here is the log output. 27-Jun-2005 11:35:15 org.hibernate.cfg.Environment <clinit> INFO: Hibernate 3.1alpha1 27-Jun-2005 11:35:15 org.hibernate.cfg.Environment <clinit> INFO: hibernate.properties not found 27-Jun-2005 11:35:15 org.hibernate.cfg.Environment <clinit> INFO: using CGLIB reflection optimizer 27-Jun-2005 11:35:15 org.hibernate.cfg.Environment <clinit> INFO: using JDK 1.4 java.sql.Timestamp handling 27-Jun-2005 11:35:15 org.hibernate.cfg.Configuration configure INFO: configuring from resource: /hibernate.cfg.xml 27-Jun-2005 11:35:15 org.hibernate.cfg.Configuration getConfigurationInputStream INFO: Configuration resource: /hibernate.cfg.xml 27-Jun-2005 11:35:15 org.hibernate.cfg.Configuration doConfigure INFO: Configured SessionFactory: null 27-Jun-2005 11:35:15 org.hibernate.cfg.Configuration secondPassCompile INFO: processing extends queue 27-Jun-2005 11:35:15 org.hibernate.cfg.Configuration secondPassCompile INFO: processing collection mappings 27-Jun-2005 11:35:15 org.hibernate.cfg.Configuration secondPassCompile INFO: processing association property references 27-Jun-2005 11:35:15 org.hibernate.cfg.Configuration secondPassCompile INFO: processing foreign key constraints 27-Jun-2005 11:35:16 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: Using Hibernate built-in connection pool (not for production use!) 27-Jun-2005 11:35:16 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: Hibernate connection pool size: 20 27-Jun-2005 11:35:16 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: autocommit mode: false 27-Jun-2005 11:35:16 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://auk.dolby.net/coreinv 27-Jun-2005 11:35:16 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: connection properties: {user=pics, password=****} 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: RDBMS: MySQL, version: 4.0.18-max 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.7 ( $Date: 2005/01/25 19:11:41 $, $Revision: 1.27.4.54 $ ) 27-Jun-2005 11:35:16 org.hibernate.dialect.Dialect <init> INFO: Using dialect: org.hibernate.dialect.MySQLDialect 27-Jun-2005 11:35:16 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory INFO: Using default transaction strategy (direct JDBC transactions) 27-Jun-2005 11:35:16 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Automatic flush during beforeCompletion(): disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Automatic session close at end of transaction: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC batch size: 15 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC batch updates for versioned data: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Scrollable result sets: enabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC3 getGeneratedKeys(): enabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Connection release mode: null 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Maximum outer join fetch depth: 2 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Default batch fetch size: 1 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Generate SQL with comments: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Order SQL updates by primary key: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 27-Jun-2005 11:35:16 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init> INFO: Using ASTQueryTranslatorFactory 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Query language substitutions: {} 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Second-level cache: enabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Query cache: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory createCacheProvider INFO: Cache provider: org.hibernate.cache.EhCacheProvider 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Optimize cache for minimal puts: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Structured second-level cache entries: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Echoing all SQL to stdout 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Statistics: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Deleted entity synthetic identifier rollback: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Default entity-mode: pojo 27-Jun-2005 11:35:16 org.hibernate.impl.SessionFactoryImpl <init> INFO: building session factory 27-Jun-2005 11:35:16 net.sf.ehcache.config.Configurator configure WARNING: No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/home/djb/.maven/repository/ehcache/jars/ehcache-1.1.jar!/ehcache-failsafe.xml 27-Jun-2005 11:35:16 org.hibernate.tuple.PojoTuplizer buildProxyFactory SEVERE: Getters of lazy classes cannot be final: com.dolby.pics.core.db.model.impl.BusinessUnit.lifecycle 27-Jun-2005 11:35:16 org.hibernate.impl.SessionFactoryObjectFactory addInstance INFO: Not binding factory to JNDI, no JNDI name configured 27-Jun-2005 11:35:16 org.hibernate.impl.SessionFactoryImpl checkNamedQueries INFO: Checking 2 named queries Hibernate: select businessun0_.BU_NAME as BU1_, businessun0_.BU_DESCRIPTION as BU2_0_, businessun0_.createdByUser as createdB3_0_, businessun0_.createdBySystem as createdB4_0_, businessun0_.createdTimestamp as createdT5_0_, businessun0_.updatedByUser as updatedB6_0_, businessun0_.updatedBySystem as updatedB7_0_, businessun0_.updatedTimestamp as updatedT8_0_ from ZCOREINV_BUSINESS_UNIT businessun0_ 27-Jun-2005 11:35:17 org.hibernate.util.JDBCExceptionReporter logExceptions WARNING: SQL Error: 1054, SQLState: 42S22 27-Jun-2005 11:35:17 org.hibernate.util.JDBCExceptionReporter logExceptions SEVERE: Unknown column 'businessun0_.createdByUser' in 'field list' Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:70) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:1861) at org.hibernate.loader.Loader.list(Loader.java:1842) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:407) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:273) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:850) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74) at Go.main(Go.java:22) Caused by: java.sql.SQLException: Unknown column 'businessun0_.createdByUser' in 'field list' at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2847) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1622) at com.mysql.jdbc.Connection.execSQL(Connection.java:2376) at com.mysql.jdbc.Connection.execSQL(Connection.java:2297) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1860) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1705) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:120) at org.hibernate.loader.Loader.getResultSet(Loader.java:1537) at org.hibernate.loader.Loader.doQuery(Loader.java:638) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:221) at org.hibernate.loader.Loader.doList(Loader.java:1858) ... 6 more Thanks :)

    Hibernate JIRA | 1 decade ago | Darren Bell
    org.hibernate.exception.SQLGrammarException: could not execute query
  2. 0

    @Column annotations on a getters within an @Embeddable object are getting ignored. The embeddable is seen but the generated sql is using the properties and not the column name. Below is the code. ------------------------------------------------------------------------ package com.dolby.pics.core.db.model.impl; import java.util.HashSet; import java.util.Set; import javax.persistence.Column; import javax.persistence.Embedded; import javax.persistence.Entity; import javax.persistence.GeneratorType; import javax.persistence.Id; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Table; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; import com.dolby.pics.core.db.model.IBusinessUnit; import com.dolby.pics.core.db.util.EntityObject; import com.dolby.pics.core.db.util.ILifecycle; /** * @author <a href="mailto:djb@dolby.co.uk">Darren Bell</a> - Dolby Laboratories Inc. * Data class for Business Units */ @Entity @Table(name="BUSINESS_UNIT", schema="ZCOREINV") @NamedQueries({ @NamedQuery( name="query.BusinessUnit.single.byName", queryString="from BusinessUnit bu where bu.name = :name"), @NamedQuery( name="query.BusinessUnit.all", queryString="from BusinessUnit bu") }) public class BusinessUnit extends EntityObject implements IBusinessUnit { /** * */ private static final long serialVersionUID = 4120848867379065142L; /** query to return a business unit by name */ public static final String QUERY_BY_NAME = "query.BusinessUnit.single.byName"; //$NON-NLS-1$ /** query to return all business units */ public static final String QUERY_ALL = "query.BusinessUnit.all"; //$NON-NLS-1$ /** name attribute */ public static final String ATTR_NAME = "name"; //$NON-NLS-1$ private String fName; private String fDescription; /** The lifecycle for this entity */ protected ILifecycle fLifecycle; /** * default cons */ BusinessUnit() { super(); } /** * Creates a new business unit with the given name * @param name The name for this business unit */ public BusinessUnit(final String name) { this(name, null); } /** * Creates a business unit with the provided name and description * @param name Name of business unit * @param desc Business unit description */ public BusinessUnit(final String name, final String desc) { super(); setName(name); setDescription(desc); } /** * Returns the description for this business unit * @return Returns the description. */ @Column(name="BU_DESCRIPTION", length=128, nullable=false) public String getDescription() { return fDescription; } /** * Sets the description for this business unit * @param description The description to set. */ public void setDescription(final String description) { fDescription = description; } /** * Gets the name of this business unit * @return Returns the name. * @hibernate.id * unsaved-value="null" * generator-class="assigned" * column="BU_NAME" * type="string" * length="5" */ @Id(generate=GeneratorType.NONE) @Column(name="BU_NAME") public String getName() { return fName; } /** * Sets the name for this business unit * @param name The name to set. */ private void setName(final String name) { fName = name; } /** * Return a string rpresentation of this business unit * @see java.lang.Object#toString() */ public String toString() { return getName(); } /** * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(final Object obj) { // do NOT use instanceof! if (obj != null && getClass() == obj.getClass()) { //BusinessUnit rhs = (BusinessUnit) obj; return new EqualsBuilder() .append(getName(), ((IBusinessUnit) obj).getName()) .isEquals(); } return false; } /** * @see java.lang.Object#hashCode() */ public int hashCode() { return new HashCodeBuilder(17, 37) .append(getName()) .toHashCode(); } /** * Sets the new lifecycle for this entity * @param lifecycle The new lifecycle */ protected void setLifecycle(final ILifecycle lifecycle) { fLifecycle = lifecycle; } /** * Gets the lifecycle object for this entity * @see com.dolby.pics.core.db.system.IEntityLifecycle#getLifecycle() * @return This entitys lifecycle */ @Embedded public final ILifecycle getLifecycle() { return fLifecycle; } } -------------------------------------------------------------------- /* Copyright 2005 Dolby Laboratories Inc. All rights reserved. * See license distributed with this file or available at * http://ukdev/license.html */ package com.dolby.pics.core.db.util; import java.io.Serializable; import java.sql.Timestamp; import javax.persistence.AccessType; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Embeddable; import javax.persistence.Transient; /** * @author <a href="mailto:djb@dolby.co.uk">Darren Bell</a> - Dolby Laboratories Inc. */ @Embeddable public class Lifecycle implements ILifecycle, Cloneable, Serializable { /** * */ private static final long serialVersionUID = 3257565113824588089L; /** User who created this entity object */ private String fCreatedByUser; /** The system that is creating/created this object */ private String fCreatedBySystem; /** The date/time that this object was created */ private Timestamp fCreatedTimestamp; /** the user who is updating/updated this object */ private String fUpdatedByUser; /** the system that is updating/updated this object */ private String fUpdatedBySystem; /** the date/time that this object is being/was updated */ private Timestamp fUpdatedTimestamp; /** * Creates a new lifecycle object */ Lifecycle() { super(); } /** * @see com.dolby.pics.core.db.system.ILifecycle#getCreatedByUser() */ @Column(name="CREATED_BY_USER", nullable=false, length=32, columnDefinition="varchar(32)", updatable=false) public String getCreatedByUser() { return fCreatedByUser; } /** * @see com.dolby.pics.core.db.system.ILifecycle#getCreatedBySystem() */ @Column(name="CREATED_BY_SYSTEM", nullable=false, length=32, updatable=false) public String getCreatedBySystem() { return fCreatedBySystem; } /** * @see com.dolby.pics.core.db.system.ILifecycle#getCreatedTimestamp() * @return the timestamp when the object was created */ @Column(name="CREATED_TIMESTAMP", nullable=false, updatable=false) public Timestamp getCreatedTimestamp() { return fCreatedTimestamp; } /** * @see com.dolby.pics.core.db.system.ILifecycle#setCreatedByUser(java.lang.String) */ public void setCreatedByUser(final String createByUser) { fCreatedByUser = createByUser; } /** * @see com.dolby.pics.core.db.system.ILifecycle#setCreatedBySystem(java.lang.String) */ public void setCreatedBySystem(final String createdBySystem) { fCreatedBySystem = createdBySystem; } /** * @see com.dolby.pics.core.db.system.ILifecycle#setCreatedTimestamp(java.sql.Timestamp) */ public void setCreatedTimestamp(final Timestamp createdTimestamp) { fCreatedTimestamp = createdTimestamp; } /** * @see com.dolby.pics.core.db.system.ILifecycle#getUpdatedByUser() */ @Column(name="UPDATED_BY_USER", length=32, insertable=false) public String getUpdatedByUser() { return fUpdatedByUser; } /** * @return the system that updated this object */ @Column(name="UPDATED_BY_SYSTEM", length=32, insertable=false) public String getUpdatedBySystem() { return fUpdatedBySystem; } /** * @return The time and date this entity was changed * @see com.dolby.pics.core.db.system.ILifecycle#getUpdatedTimestamp() */ @Column(name="UPDATED_TIMESTAMP", insertable=false) public Timestamp getUpdatedTimestamp() { return fUpdatedTimestamp; } /** * @param updatedByUser * @see com.dolby.pics.core.db.system.ILifecycle#setUpdatedByUser(java.lang.String) */ public void setUpdatedByUser(final String updatedByUser) { fUpdatedByUser = updatedByUser; } /** * @param updatedBySystem * @see com.dolby.pics.core.db.system.ILifecycle#setUpdatedBySystem(java.lang.String) */ public void setUpdatedBySystem(final String updatedBySystem) { fUpdatedBySystem = updatedBySystem; } /** * @see com.dolby.pics.core.db.system.ILifecycle#setUpdatedTimestamp(java.sql.Timestamp) */ public void setUpdatedTimestamp(final Timestamp updatedTimestamp) { fUpdatedTimestamp = updatedTimestamp; } /** * @see java.lang.Object#clone() */ protected Object clone() throws CloneNotSupportedException { Lifecycle clonedLifecycle = new Lifecycle(); clonedLifecycle.setCreatedBySystem(getCreatedBySystem()); clonedLifecycle.setCreatedByUser(getCreatedByUser()); clonedLifecycle.setCreatedTimestamp(getCreatedTimestamp()); clonedLifecycle.setUpdatedBySystem(getUpdatedBySystem()); clonedLifecycle.setUpdatedByUser(getUpdatedByUser()); clonedLifecycle.setUpdatedTimestamp(getUpdatedTimestamp()); return clonedLifecycle; } /** * Return a formatted string for this lifecycle * @see java.lang.Object#toString() */ public String toString() { //String TO_STRING = "[CREATED: by-{0}, @-{1}, in-{2}; UPDATED: by-{3}, @-{4}, in-{5}]"; //$NON-NLS-1$ return "[CREATED: by-" //$NON-NLS-1$ + getCreatedByUser() + ", @-" //$NON-NLS-1$ + getCreatedTimestamp() + ", in-" //$NON-NLS-1$ + getCreatedBySystem() + "; UPDATED: " //$NON-NLS-1$ + getUpdatedByUser() + ", @-" //$NON-NLS-1$ + getUpdatedTimestamp() + ", in-" //$NON-NLS-1$ + getUpdatedBySystem() + "]"; //$NON-NLS-1$ } } --------------------------------------------------------------------- Here is the log output. 27-Jun-2005 11:35:15 org.hibernate.cfg.Environment <clinit> INFO: Hibernate 3.1alpha1 27-Jun-2005 11:35:15 org.hibernate.cfg.Environment <clinit> INFO: hibernate.properties not found 27-Jun-2005 11:35:15 org.hibernate.cfg.Environment <clinit> INFO: using CGLIB reflection optimizer 27-Jun-2005 11:35:15 org.hibernate.cfg.Environment <clinit> INFO: using JDK 1.4 java.sql.Timestamp handling 27-Jun-2005 11:35:15 org.hibernate.cfg.Configuration configure INFO: configuring from resource: /hibernate.cfg.xml 27-Jun-2005 11:35:15 org.hibernate.cfg.Configuration getConfigurationInputStream INFO: Configuration resource: /hibernate.cfg.xml 27-Jun-2005 11:35:15 org.hibernate.cfg.Configuration doConfigure INFO: Configured SessionFactory: null 27-Jun-2005 11:35:15 org.hibernate.cfg.Configuration secondPassCompile INFO: processing extends queue 27-Jun-2005 11:35:15 org.hibernate.cfg.Configuration secondPassCompile INFO: processing collection mappings 27-Jun-2005 11:35:15 org.hibernate.cfg.Configuration secondPassCompile INFO: processing association property references 27-Jun-2005 11:35:15 org.hibernate.cfg.Configuration secondPassCompile INFO: processing foreign key constraints 27-Jun-2005 11:35:16 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: Using Hibernate built-in connection pool (not for production use!) 27-Jun-2005 11:35:16 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: Hibernate connection pool size: 20 27-Jun-2005 11:35:16 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: autocommit mode: false 27-Jun-2005 11:35:16 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://auk.dolby.net/coreinv 27-Jun-2005 11:35:16 org.hibernate.connection.DriverManagerConnectionProvider configure INFO: connection properties: {user=pics, password=****} 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: RDBMS: MySQL, version: 4.0.18-max 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.7 ( $Date: 2005/01/25 19:11:41 $, $Revision: 1.27.4.54 $ ) 27-Jun-2005 11:35:16 org.hibernate.dialect.Dialect <init> INFO: Using dialect: org.hibernate.dialect.MySQLDialect 27-Jun-2005 11:35:16 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory INFO: Using default transaction strategy (direct JDBC transactions) 27-Jun-2005 11:35:16 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Automatic flush during beforeCompletion(): disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Automatic session close at end of transaction: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC batch size: 15 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC batch updates for versioned data: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Scrollable result sets: enabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC3 getGeneratedKeys(): enabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Connection release mode: null 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Maximum outer join fetch depth: 2 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Default batch fetch size: 1 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Generate SQL with comments: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Order SQL updates by primary key: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 27-Jun-2005 11:35:16 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init> INFO: Using ASTQueryTranslatorFactory 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Query language substitutions: {} 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Second-level cache: enabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Query cache: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory createCacheProvider INFO: Cache provider: org.hibernate.cache.EhCacheProvider 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Optimize cache for minimal puts: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Structured second-level cache entries: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Echoing all SQL to stdout 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Statistics: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Deleted entity synthetic identifier rollback: disabled 27-Jun-2005 11:35:16 org.hibernate.cfg.SettingsFactory buildSettings INFO: Default entity-mode: pojo 27-Jun-2005 11:35:16 org.hibernate.impl.SessionFactoryImpl <init> INFO: building session factory 27-Jun-2005 11:35:16 net.sf.ehcache.config.Configurator configure WARNING: No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/home/djb/.maven/repository/ehcache/jars/ehcache-1.1.jar!/ehcache-failsafe.xml 27-Jun-2005 11:35:16 org.hibernate.tuple.PojoTuplizer buildProxyFactory SEVERE: Getters of lazy classes cannot be final: com.dolby.pics.core.db.model.impl.BusinessUnit.lifecycle 27-Jun-2005 11:35:16 org.hibernate.impl.SessionFactoryObjectFactory addInstance INFO: Not binding factory to JNDI, no JNDI name configured 27-Jun-2005 11:35:16 org.hibernate.impl.SessionFactoryImpl checkNamedQueries INFO: Checking 2 named queries Hibernate: select businessun0_.BU_NAME as BU1_, businessun0_.BU_DESCRIPTION as BU2_0_, businessun0_.createdByUser as createdB3_0_, businessun0_.createdBySystem as createdB4_0_, businessun0_.createdTimestamp as createdT5_0_, businessun0_.updatedByUser as updatedB6_0_, businessun0_.updatedBySystem as updatedB7_0_, businessun0_.updatedTimestamp as updatedT8_0_ from ZCOREINV_BUSINESS_UNIT businessun0_ 27-Jun-2005 11:35:17 org.hibernate.util.JDBCExceptionReporter logExceptions WARNING: SQL Error: 1054, SQLState: 42S22 27-Jun-2005 11:35:17 org.hibernate.util.JDBCExceptionReporter logExceptions SEVERE: Unknown column 'businessun0_.createdByUser' in 'field list' Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:70) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:1861) at org.hibernate.loader.Loader.list(Loader.java:1842) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:407) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:273) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:850) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74) at Go.main(Go.java:22) Caused by: java.sql.SQLException: Unknown column 'businessun0_.createdByUser' in 'field list' at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2847) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1622) at com.mysql.jdbc.Connection.execSQL(Connection.java:2376) at com.mysql.jdbc.Connection.execSQL(Connection.java:2297) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1860) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1705) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:120) at org.hibernate.loader.Loader.getResultSet(Loader.java:1537) at org.hibernate.loader.Loader.doQuery(Loader.java:638) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:221) at org.hibernate.loader.Loader.doList(Loader.java:1858) ... 6 more Thanks :)

    Hibernate JIRA | 1 decade ago | Darren Bell
    org.hibernate.exception.SQLGrammarException: could not execute query
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Hibernate Community • View topic - could not execute query with MySQL 4.1.11

    hibernate.org | 1 year ago
    org.hibernate.exception.SQLGrammarException: could not execute query
  5. 0

    !ENTRY org.hibernate.eclipse 1 10000 2005-12-22 23:15:31.828 !MESSAGE DEBUG main org.hibernate.SQL - select genmessage0_.id as id266_, genmessage0_.site_id as site2_266_, genmessage0_.module_id as module3_266_, genmessage0_.message_code as message4_266_, genmessage0_.message_text as message5_266_, genmessage0_.version as version266_, genmessage0_.last_modified_date_time as last7_266_, genmessage0_.last_modified_by as last8_266_, genmessage0_.extension01 as extension9_266_, genmessage0_.extension02 as extension10_266_, genmessage0_.extension03 as extension11_266_, genmessage0_.extension04 as extension12_266_, genmessage0_.extension05 as extension13_266_, genmessage0_.extension06 as extension14_266_, genmessage0_.extension07 as extension15_266_, genmessage0_.extension08 as extension16_266_, genmessage0_.extension09 as extension17_266_, genmessage0_.extension10 as extension18_266_, genmessage0_.extension11 as extension19_266_, genmessage0_.extension12 as extension20_266_, genmessage0_.extension13 as extension21_266_, genmessage0_.extension14 as extension22_266_, genmessage0_.extension15 as extension23_266_, genmessage0_.extension17 as extension24_266_, genmessage0_.extension16 as extension25_266_, genmessage0_.extension18 as extension26_266_, genmessage0_.extension19 as extension27_266_, genmessage0_.extension20 as extension28_266_ from asset.asset.gen_messages genmessage0_ !ENTRY org.hibernate.eclipse 2 30000 2005-12-22 23:15:31.843 !MESSAGE WARN main org.hibernate.util.JDBCExceptionReporter - SQL Error: 1064, SQLState: 42000 !ENTRY org.hibernate.eclipse 4 40000 2005-12-22 23:15:31.843 !MESSAGE ERROR main 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 '.gen_messages genmessage0_' at line 1 !ENTRY org.hibernate.eclipse.console 4 150 2005-12-22 23:15:31.843 !MESSAGE Exception while executing HQL Query !SUBENTRY 1 org.hibernate.eclipse.console 4 150 2005-12-22 23:15:31.843 !MESSAGE org.hibernate.exception.SQLGrammarException: could not execute query !STACK 0 org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2161) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2037) at org.hibernate.loader.Loader.list(Loader.java:2032) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:300) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:146) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1093) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at org.hibernate.console.HQLQueryPage.getList(HQLQueryPage.java:33) at org.hibernate.eclipse.console.views.QueryPageViewer$ContentProviderImpl.getElements(QueryPageViewer.java:80) at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:848) at org.eclipse.jface.viewers.TableViewer.getRawChildren(TableViewer.java:1086) at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredViewer.java:790) at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:905) at org.eclipse.jface.viewers.TableViewer.internalRefreshAll(TableViewer.java:798) at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:748) at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:737) at org.eclipse.jface.viewers.StructuredViewer$7.run(StructuredViewer.java:1264) at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1201) at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1262) at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1221) at org.eclipse.jface.viewers.TableViewer.inputChanged(TableViewer.java:698) at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:248) at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1417) at org.hibernate.eclipse.console.views.QueryPageViewer.createTable(QueryPageViewer.java:174) at org.hibernate.eclipse.console.views.QueryPageViewer.createControl(QueryPageViewer.java:153) at org.hibernate.eclipse.console.views.QueryPageViewer.<init>(QueryPageViewer.java:111) at org.hibernate.eclipse.console.views.QueryPageTabView.rebuild(QueryPageTabView.java:88) at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:52) at org.hibernate.eclipse.console.views.QueryPageTabView$1.intervalAdded(QueryPageTabView.java:62) at javax.swing.AbstractListModel.fireIntervalAdded(Unknown Source) at org.hibernate.console.QueryPageModel.add(QueryPageModel.java:50) at org.hibernate.console.KnownConfigurations$1.queryPageCreated(KnownConfigurations.java:60) at org.hibernate.console.ConsoleConfiguration.fireQueryPageCreated(ConsoleConfiguration.java:306) at org.hibernate.console.ConsoleConfiguration.access$5(ConsoleConfiguration.java:302) at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:295) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35) at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:287) at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:282) at org.hibernate.eclipse.console.views.KnownConfigurationsView$3.run(KnownConfigurationsView.java:133) at org.hibernate.eclipse.console.views.KnownConfigurationsView$1.doubleClick(KnownConfigurationsView.java:77) at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:720) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044) at org.eclipse.core.runtime.Platform.run(Platform.java:783) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148) at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:718) at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:950) at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1057) at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:219) at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:216) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:275) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948) Caused by: java.sql.SQLException: 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 '.gen_messages genmessage0_' at line 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666) at com.mysql.jdbc.Connection.execSQL(Connection.java:2994) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:936) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1030) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139) at org.hibernate.loader.Loader.getResultSet(Loader.java:1677) at org.hibernate.loader.Loader.doQuery(Loader.java:662) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2158) ... 71 more !SUBENTRY 2 org.hibernate.eclipse.console 4 150 2005-12-22 23:15:31.843 !MESSAGE org.hibernate.exception.SQLGrammarException: could not execute query !STACK 0 org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2161) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2037) at org.hibernate.loader.Loader.list(Loader.java:2032) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:300) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:146) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1093) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at org.hibernate.console.HQLQueryPage.getList(HQLQueryPage.java:33) at org.hibernate.eclipse.console.views.QueryPageViewer$ContentProviderImpl.getElements(QueryPageViewer.java:80) at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:848) at org.eclipse.jface.viewers.TableViewer.getRawChildren(TableViewer.java:1086) at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredViewer.java:790) at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:905) at org.eclipse.jface.viewers.TableViewer.internalRefreshAll(TableViewer.java:798) at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:748) at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:737) at org.eclipse.jface.viewers.StructuredViewer$7.run(StructuredViewer.java:1264) at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1201) at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1262) at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1221) at org.eclipse.jface.viewers.TableViewer.inputChanged(TableViewer.java:698) at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:248) at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1417) at org.hibernate.eclipse.console.views.QueryPageViewer.createTable(QueryPageViewer.java:174) at org.hibernate.eclipse.console.views.QueryPageViewer.createControl(QueryPageViewer.java:153) at org.hibernate.eclipse.console.views.QueryPageViewer.<init>(QueryPageViewer.java:111) at org.hibernate.eclipse.console.views.QueryPageTabView.rebuild(QueryPageTabView.java:88) at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:52) at org.hibernate.eclipse.console.views.QueryPageTabView$1.intervalAdded(QueryPageTabView.java:62) at javax.swing.AbstractListModel.fireIntervalAdded(Unknown Source) at org.hibernate.console.QueryPageModel.add(QueryPageModel.java:50) at org.hibernate.console.KnownConfigurations$1.queryPageCreated(KnownConfigurations.java:60) at org.hibernate.console.ConsoleConfiguration.fireQueryPageCreated(ConsoleConfiguration.java:306) at org.hibernate.console.ConsoleConfiguration.access$5(ConsoleConfiguration.java:302) at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:295) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35) at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:287) at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:282) at org.hibernate.eclipse.console.views.KnownConfigurationsView$3.run(KnownConfigurationsView.java:133) at org.hibernate.eclipse.console.views.KnownConfigurationsView$1.doubleClick(KnownConfigurationsView.java:77) at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:720) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044) at org.eclipse.core.runtime.Platform.run(Platform.java:783) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148) at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:718) at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:950) at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1057) at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:219) at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:216) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:275) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948) Caused by: java.sql.SQLException: 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 '.gen_messages genmessage0_' at line 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666) at com.mysql.jdbc.Connection.execSQL(Connection.java:2994) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:936) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1030) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139) at org.hibernate.loader.Loader.getResultSet(Loader.java:1677) at org.hibernate.loader.Loader.doQuery(Loader.java:662) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2158) ... 71 more !SUBENTRY 2 org.hibernate.eclipse.console 4 150 2005-12-22 23:15:31.843 !MESSAGE java.sql.SQLException: 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 '.gen_messages genmessage0_' at line 1 !STACK 0 java.sql.SQLException: 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 '.gen_messages genmessage0_' at line 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666) at com.mysql.jdbc.Connection.execSQL(Connection.java:2994) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:936) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1030) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139) at org.hibernate.loader.Loader.getResultSet(Loader.java:1677) at org.hibernate.loader.Loader.doQuery(Loader.java:662) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2158) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2037) at org.hibernate.loader.Loader.list(Loader.java:2032) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:300) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:146) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1093) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at org.hibernate.console.HQLQueryPage.getList(HQLQueryPage.java:33) at org.hibernate.eclipse.console.views.QueryPageViewer$ContentProviderImpl.getElements(QueryPageViewer.java:80) at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:848) at org.eclipse.jface.viewers.TableViewer.getRawChildren(TableViewer.java:1086) at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredViewer.java:790) at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:905) at org.eclipse.jface.viewers.TableViewer.internalRefreshAll(TableViewer.java:798) at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:748) at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:737) at org.eclipse.jface.viewers.StructuredViewer$7.run(StructuredViewer.java:1264) at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1201) at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1262) at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1221) at org.eclipse.jface.viewers.TableViewer.inputChanged(TableViewer.java:698) at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:248) at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1417) at org.hibernate.eclipse.console.views.QueryPageViewer.createTable(QueryPageViewer.java:174) at org.hibernate.eclipse.console.views.QueryPageViewer.createControl(QueryPageViewer.java:153) at org.hibernate.eclipse.console.views.QueryPageViewer.<init>(QueryPageViewer.java:111) at org.hibernate.eclipse.console.views.QueryPageTabView.rebuild(QueryPageTabView.java:88) at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:52) at org.hibernate.eclipse.console.views.QueryPageTabView$1.intervalAdded(QueryPageTabView.java:62) at javax.swing.AbstractListModel.fireIntervalAdded(Unknown Source) at org.hibernate.console.QueryPageModel.add(QueryPageModel.java:50) at org.hibernate.console.KnownConfigurations$1.queryPageCreated(KnownConfigurations.java:60) at org.hibernate.console.ConsoleConfiguration.fireQueryPageCreated(ConsoleConfiguration.java:306) at org.hibernate.console.ConsoleConfiguration.access$5(ConsoleConfiguration.java:302) at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:295) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35) at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:287) at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:282) at org.hibernate.eclipse.console.views.KnownConfigurationsView$3.run(KnownConfigurationsView.java:133) at org.hibernate.eclipse.console.views.KnownConfigurationsView$1.doubleClick(KnownConfigurationsView.java:77) at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:720) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044) at org.eclipse.core.runtime.Platform.run(Platform.java:783) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148) at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:718) at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:950) at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1057) at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:219) at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:216) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:275) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948)

    Hibernate JIRA | 1 decade ago | Syam Kumar
    org.hibernate.exception.SQLGrammarException: could not execute query

  1. Kialandei 1 times, last 1 week ago
  2. poroszd 1 times, last 1 year ago
11 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. java.sql.SQLException

    Unknown column 'businessun0_.createdByUser' in 'field list'

    at com.mysql.jdbc.MysqlIO.checkErrorPacket()
  2. MySQL jdbc
    PreparedStatement.executeQuery
    1. com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2847)
    2. com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)
    3. com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1622)
    4. com.mysql.jdbc.Connection.execSQL(Connection.java:2376)
    5. com.mysql.jdbc.Connection.execSQL(Connection.java:2297)
    6. com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1860)
    7. com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1705)
    7 frames
  3. Hibernate
    QueryLoader.list
    1. org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:120)
    2. org.hibernate.loader.Loader.getResultSet(Loader.java:1537)
    3. org.hibernate.loader.Loader.doQuery(Loader.java:638)
    4. org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:221)
    5. org.hibernate.loader.Loader.doList(Loader.java:1858)
    6. org.hibernate.loader.Loader.list(Loader.java:1842)
    7. org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:407)
    7 frames
  4. Hibernate HQL/JP-QL Parser
    QueryTranslatorImpl.list
    1. org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:273)
    1 frame
  5. Hibernate
    QueryImpl.list
    1. org.hibernate.impl.SessionImpl.list(SessionImpl.java:850)
    2. org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
    2 frames
  6. Unknown
    Go.main
    1. Go.main(Go.java:22)
    1 frame