i have tested my firstName.java successfully. but when i test testErvice.java, the output and errors as below shown:
Feb 17, 2006 9:00:16 AM org.hibernate.cfg.Environment <clinit> INFO: Hibernate 3.0.5 Feb 17, 2006 9:00:16 AM org.hibernate.cfg.Environment <clinit> INFO: hibernate.properties not found Feb 17, 2006 9:00:16 AM org.hibernate.cfg.Environment <clinit> INFO: using CGLIB reflection optimizer Feb 17, 2006 9:00:16 AM org.hibernate.cfg.Environment <clinit> INFO: using JDK 1.4 java.sql.Timestamp handling Feb 17, 2006 9:00:16 AM org.hibernate.cfg.Configuration configure INFO: configuring from resource: /hibernate.cfg.xml Feb 17, 2006 9:00:16 AM org.hibernate.cfg.Configuration getConfigurationInputStream INFO: Configuration resource: /hibernate.cfg.xml Feb 17, 2006 9:00:16 AM org.hibernate.cfg.Configuration addResource INFO: Mapping resource: model/User.hbm.xml Feb 17, 2006 9:00:16 AM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues INFO: Mapping class: model.User -> USER Feb 17, 2006 9:00:16 AM org.hibernate.cfg.Configuration addResource INFO: Mapping resource: model/Service.hbm.xml Feb 17, 2006 9:00:16 AM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues INFO: Mapping class: model.Service -> SERVICE Feb 17, 2006 9:00:16 AM org.hibernate.cfg.Configuration addResource INFO: Mapping resource: model/Authorizer.hbm.xml Feb 17, 2006 9:00:16 AM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues INFO: Mapping class: model.Authorizer -> AUTHORIZER Feb 17, 2006 9:00:16 AM org.hibernate.cfg.Configuration addResource INFO: Mapping resource: model/Company.hbm.xml Feb 17, 2006 9:00:16 AM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues INFO: Mapping class: model.Company -> COMPANY Feb 17, 2006 9:00:16 AM org.hibernate.cfg.Configuration addResource INFO: Mapping resource: model/ServiceType.hbm.xml Feb 17, 2006 9:00:16 AM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues INFO: Mapping class: model.ServiceType -> SERVICE_TYPE Feb 17, 2006 9:00:16 AM org.hibernate.cfg.Configuration doConfigure INFO: Configured SessionFactory: null Feb 17, 2006 9:00:16 AM org.hibernate.cfg.Configuration secondPassCompile INFO: processing extends queue Feb 17, 2006 9:00:16 AM org.hibernate.cfg.Configuration secondPassCompile INFO: processing collection mappings Feb 17, 2006 9:00:16 AM org.hibernate.cfg.HbmBinder bindCollectionSecondPass INFO: Mapping collection: model.User.userInfo -> SERVICE Feb 17, 2006 9:00:16 AM org.hibernate.cfg.HbmBinder bindCollectionSecondPass INFO: Mapping collection: model.Service.serviceInfo -> AUTHORIZER Feb 17, 2006 9:00:16 AM org.hibernate.cfg.Configuration secondPassCompile INFO: processing association property references Feb 17, 2006 9:00:16 AM org.hibernate.cfg.Configuration secondPassCompile INFO: processing foreign key constraints Feb 17, 2006 9:00:16 AM org.hibernate.connection.DriverManagerConnectionProvider configure INFO: Using Hibernate built-in connection pool (not for production use!) Feb 17, 2006 9:00:16 AM org.hibernate.connection.DriverManagerConnectionProvider configure INFO: Hibernate connection pool size: 10 Feb 17, 2006 9:00:16 AM org.hibernate.connection.DriverManagerConnectionProvider configure INFO: autocommit mode: false Feb 17, 2006 9:00:16 AM org.hibernate.connection.DriverManagerConnectionProvider configure INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/symis Feb 17, 2006 9:00:16 AM org.hibernate.connection.DriverManagerConnectionProvider configure INFO: connection properties: {user=user, password=****} Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: RDBMS: MySQL, version: 4.1.13-nt Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.11 ( $Date: 2005-09-21 18:20:03 +0000 (Wed, 21 Sep 2005) $, $Revision: 4287 $ ) Feb 17, 2006 9:00:17 AM org.hibernate.dialect.Dialect <init> INFO: Using dialect: org.hibernate.dialect.MySQLDialect Feb 17, 2006 9:00:17 AM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory INFO: Using default transaction strategy (direct JDBC transactions) Feb 17, 2006 9:00:17 AM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: Automatic flush during beforeCompletion(): disabled Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: Automatic session close at end of transaction: disabled Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC batch size: 15 Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC batch updates for versioned data: disabled Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: Scrollable result sets: enabled Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: JDBC3 getGeneratedKeys(): enabled Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: Connection release mode: null Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: Maximum outer join fetch depth: 2 Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: Default batch fetch size: 1 Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: Generate SQL with comments: disabled Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: Order SQL updates by primary key: disabled Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory Feb 17, 2006 9:00:17 AM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init> INFO: Using ASTQueryTranslatorFactory Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: Query language substitutions: {} Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: Second-level cache: enabled Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: Query cache: disabled Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory createCacheProvider INFO: Cache provider: org.hibernate.cache.EhCacheProvider Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: Optimize cache for minimal puts: disabled Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: Structured second-level cache entries: disabled Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: Echoing all SQL to stdout Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: Statistics: disabled Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: Deleted entity synthetic identifier rollback: disabled Feb 17, 2006 9:00:17 AM org.hibernate.cfg.SettingsFactory buildSettings INFO: Default entity-mode: pojo Feb 17, 2006 9:00:17 AM org.hibernate.impl.SessionFactoryImpl <init> INFO: building session factory Feb 17, 2006 9:00:17 AM net.sf.ehcache.config.Configurator configure WARNING: No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/D:/eclipse/plugins/hibernate-2.1/lib/ehcache-0.9.jar!/ehcache-failsafe.xml Feb 17, 2006 9:00:18 AM org.hibernate.impl.SessionFactoryObjectFactory addInstance INFO: Not binding factory to JNDI, no JNDI name configured Feb 17, 2006 9:00:18 AM org.hibernate.dialect.Dialect <init> INFO: Using dialect: org.hibernate.dialect.MySQLDialect Feb 17, 2006 9:00:18 AM org.hibernate.connection.DriverManagerConnectionProvider configure INFO: Using Hibernate built-in connection pool (not for production use!) Feb 17, 2006 9:00:18 AM org.hibernate.connection.DriverManagerConnectionProvider configure INFO: Hibernate connection pool size: 10 Feb 17, 2006 9:00:18 AM org.hibernate.connection.DriverManagerConnectionProvider configure INFO: autocommit mode: false Feb 17, 2006 9:00:18 AM org.hibernate.connection.DriverManagerConnectionProvider configure INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/symis Feb 17, 2006 9:00:18 AM org.hibernate.connection.DriverManagerConnectionProvider configure INFO: connection properties: {user=user, password=****} Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.SchemaUpdate execute INFO: Running hbm2ddl schema update Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.SchemaUpdate execute INFO: fetching database metadata Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.SchemaUpdate execute INFO: updating schema Feb 17, 2006 9:00:18 AM org.hibernate.cfg.Configuration secondPassCompile INFO: processing extends queue Feb 17, 2006 9:00:18 AM org.hibernate.cfg.Configuration secondPassCompile INFO: processing collection mappings Feb 17, 2006 9:00:18 AM org.hibernate.cfg.Configuration secondPassCompile INFO: processing association property references Feb 17, 2006 9:00:18 AM org.hibernate.cfg.Configuration secondPassCompile INFO: processing foreign key constraints Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: table found: symis.authorizer Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: columns: [service_id, autho_id, date, roles, service_info, name, autho_remarks] Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: foreign keys: [fk2_service_id, fkc376e1a9b61c9705] Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: indexes: [primary, service_id, fk2_service_id] Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: table found: symis.company Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: columns: [address2, tel_no, address3, address1, fax, name, company_id] Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: foreign keys: [] Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: indexes: [primary] Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: table found: symis.service Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: columns: [require_date, service, emp_no, issue_date, service_id, service_remarks, user_info, state] Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: foreign keys: [fk1_emp_no, fka10f52957a2140b8] Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: indexes: [emp_no, primary, fk1_emp_no] Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: table found: symis.service_type Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: columns: [service_type_id, description] Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: foreign keys: [] Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: indexes: [primary] Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: table found: symis.user Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: columns: [emp_no, designation, ext_no, last_name, first_name, department, company] Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: foreign keys: [] Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.TableMetadata <init> INFO: indexes: [primary] Feb 17, 2006 9:00:18 AM org.hibernate.tool.hbm2ddl.SchemaUpdate execute INFO: schema update complete Feb 17, 2006 9:00:18 AM org.hibernate.connection.DriverManagerConnectionProvider close INFO: cleaning up connection pool: jdbc:mysql://localhost/symis Feb 17, 2006 9:00:18 AM org.hibernate.impl.SessionFactoryImpl checkNamedQueries INFO: Checking 0 named queries Inserting Record
not-null property references a null or transient value: model.Service.empNoorg.hibernate.PropertyValueException: not-null property references a null or transient value: model.Service.empNo at org.hibernate.engine.Nullability.checkNullability(Nullability.java:72) at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:164) at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:190) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:70) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730) at test.testService.main(testService.java:39) Exception in thread "main"
my service.hbm.xml is as shown below:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping > <class name="model.Service" table="SERVICE" >
<id name="serviceId" column="SERVICE_ID" type="java.lang.String" > <generator class="assigned"> <!-- To add non XDoclet generator parameters, create a file named hibernate-generator-params-Service.xml containing the additional parameters and place it in your merge dir. --> </generator> </id>
<property name="requireDate" type="date" update="true" insert="true" > <column name="REQUIRE_DATE" /> </property>
<property name="issueDate" type="date" update="true" insert="true" > <column name="ISSUE_DATE" /> </property>
<many-to-one name="empNo" class="model.User" cascade="none" lazy="false" update="true" insert="true" foreign-key="FK1_EMP_NO" column="EMP_NO" not-null="true" /> <property name="sv_userInfo" type="string" update="true" insert="true" > <column name="USER_INFO" /> </property>
<property name="state" type="int" update="true" insert="true" > <column name="STATE" /> </property>
<property name="serviceRemarks" type="string" update="true" insert="true" > <column name="SERVICE_REMARKS" /> </property>
<property name="service" type="string" update="true" insert="true" > <column name="SERVICE" /> </property> <list name="serviceInfo" lazy="false" inverse="true" cascade="none" >
<key column="SERVICE_ID" > </key>
<index column="SERVICE_INFO" type="string" />
<one-to-many class="model.Authorizer" />
</list>
<!-- To add non XDoclet property mappings, create a file named hibernate-properties-Service.xml containing the additional properties and place it in your merge dir. -->
</class>
</hibernate-mapping>
can anyone comment about this? thanks in advance.
|