Here's the table used by the mapping.
TABLE:
CREATE TABLE roi
(
roi_id serial NOT NULL,
"location" text,
drive char(1),
root text,
add_roi text,
subtract_roi text,
roi text,
CONSTRAINT roi_pkey PRIMARY KEY (roi_id)
)
richie wrote:
I am using Hibernate 3.0.5 and have encountered a weird problem where a particular column is not included in the SQL though it has been stated in the mapping. I just want to verify that it is a subtle problem that my mapping may have introduced before actually concluding that it could be a bug.
The generated query does not include the column 'roi' which has been mapped to property 'originalRoi'. Is this a side-effect of the bug fix for duplicate columns (Jira Key HB-1413)?
Thanks.
Hibernate version:
SYSTEM
======
OS - Windows XP Professional
JRE Version - 1.5.0_04-b05
Hibernate Version - 3.0.5 (binary download)
Mapping documents:
HIBERNATE MAPPING
=================
<?xml version='1.0'?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"config/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="model.RegionOfInterest" table="roi">
<id name="id" column="roi_id">
<generator class="sequence"/>
</id>
<property name="originalRoi" type="string" column="roi"/>
<property name="location" column="location"/>
<property name="drive" column="drive"/>
<property name="root" column="root"/>
<property name="addRoi" type="string" column="add_roi"/>
<property name="subtractRoi" type="string" column="subtract_roi"/>
</class>
</hibernate-mapping>
Name and version of the database you are using:
PostgreSQL - 8.0
The generated SQL (show_sql=true):
Hibernate: select regionofin0_.roi_id as roi1_0_, regionofin0_.location as location1_0_, regionofin0_.drive as drive1_0_,
regionofin0_.root as root1_0_, regionofin0_.add_roi as add6_1_0_, regionofin0_.subtract_roi as subtract7_1_0_
from roi regionofin0_ where regionofin0_.roi_id=?
Debug level Hibernate log excerpt:
Sep 16, 2005 6:54:20 PM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.0.5
Sep 16, 2005 6:54:20 PM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
Sep 16, 2005 6:54:20 PM org.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
Sep 16, 2005 6:54:20 PM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
Sep 16, 2005 6:54:20 PM org.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
Sep 16, 2005 6:54:20 PM org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
Sep 16, 2005 6:54:21 PM org.hibernate.cfg.Configuration addResource
INFO: Mapping resource: edu/ucla/rip/dld/model/LungRegion.hbm.xml
Sep 16, 2005 6:54:21 PM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: edu.ucla.rip.dld.model.LungRegion -> lung_region
Sep 16, 2005 6:54:21 PM org.hibernate.cfg.Configuration addResource
INFO: Mapping resource: edu/ucla/rip/dld/model/RegionOfInterest.hbm.xml
Sep 16, 2005 6:54:21 PM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: edu.ucla.rip.dld.model.RegionOfInterest -> roi
Sep 16, 2005 6:54:21 PM org.hibernate.cfg.Configuration addResource
INFO: Mapping resource: edu/ucla/rip/domain/ResourceLocation.hbm.xml
Sep 16, 2005 6:54:21 PM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: edu.ucla.rip.domain.ResourceLocation -> network
Sep 16, 2005 6:54:21 PM org.hibernate.cfg.Configuration doConfigure
INFO: Configured SessionFactory: null
Sep 16, 2005 6:54:21 PM org.hibernate.cfg.Configuration secondPassCompile
INFO: processing extends queue
Sep 16, 2005 6:54:21 PM org.hibernate.cfg.Configuration secondPassCompile
INFO: processing collection mappings
Sep 16, 2005 6:54:21 PM org.hibernate.cfg.Configuration secondPassCompile
INFO: processing association property references
Sep 16, 2005 6:54:21 PM org.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
Sep 16, 2005 6:54:22 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
Sep 16, 2005 6:54:22 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 5
Sep 16, 2005 6:54:22 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: autocommit mode: false
Sep 16, 2005 6:54:22 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: org.postgresql.Driver at URL: jdbc:postgresql://localhost:5432/qiws
Sep 16, 2005 6:54:22 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=polling, password=****}
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: RDBMS: PostgreSQL, version: 8.0.3
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.0 JDBC3g with SSL (build 311)
Sep 16, 2005 6:54:22 PM org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernate.dialect.PostgreSQLDialect
Sep 16, 2005 6:54:22 PM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
INFO: Using default transaction strategy (direct JDBC transactions)
Sep 16, 2005 6:54:22 PM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic flush during beforeCompletion(): disabled
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic session close at end of transaction: disabled
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch size: 15
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch updates for versioned data: disabled
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Scrollable result sets: enabled
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC3 getGeneratedKeys(): disabled
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Connection release mode: null
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default batch fetch size: 1
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Generate SQL with comments: disabled
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL updates by primary key: disabled
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
Sep 16, 2005 6:54:22 PM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
INFO: Using ASTQueryTranslatorFactory
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Second-level cache: enabled
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query cache: disabled
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory createCacheProvider
INFO: Cache provider: org.hibernate.cache.EhCacheProvider
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: disabled
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Structured second-level cache entries: disabled
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Echoing all SQL to stdout
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Statistics: disabled
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Deleted entity synthetic identifier rollback: disabled
Sep 16, 2005 6:54:22 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default entity-mode: pojo
Sep 16, 2005 6:54:22 PM org.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Sep 16, 2005 6:54:22 PM net.sf.ehcache.config.Configurator configure
WARNING: No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/jws/branches/release-7-25-05/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
Sep 16, 2005 6:54:22 PM org.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: Not binding factory to JNDI, no JNDI name configured
Sep 16, 2005 6:54:22 PM org.hibernate.impl.SessionFactoryImpl checkNamedQueries
INFO: Checking 0 named queries