now i have changed that Maven project into simple java application. . .
config.xml file is as follows rest of the code is same
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.dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@192.1.200.32:1521:orcl</property>
<property name="hibernate.connection.username">****</property>
<property name="hibernate.connection.password">******</property>
<property name="current_session_context_class">thread</property>
<mapping class="javaapplication42.Employee"/>
</session-factory>
</hibernate-configuration>
Exception i am getting is
Code:
0 [main] INFO annotations.Version - Hibernate Annotations 3.4.0.GA
29 [main] INFO cfg.Environment - Hibernate 3.2.3
35 [main] INFO cfg.Environment - hibernate.properties not found
43 [main] INFO cfg.Environment - Bytecode provider name : cglib
50 [main] INFO cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
133 [main] INFO common.Version - Hibernate Commons Annotations 3.1.0.GA
139 [main] INFO cfg.Configuration - configuring from resource: /hibernate.cfg.xml
141 [main] INFO cfg.Configuration - Configuration resource: /hibernate.cfg.xml
283 [main] INFO cfg.Configuration - Configured SessionFactory: null
296 [main] INFO search.HibernateSearchEventListenerRegister - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
348 [main] INFO cfg.AnnotationConfiguration - Hibernate Validator not found: ignoring
357 [main] INFO connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
358 [main] INFO connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20
359 [main] INFO connection.DriverManagerConnectionProvider - autocommit mode: false
384 [main] INFO connection.DriverManagerConnectionProvider - using driver: oracle.jdbc.OracleDriver at URL: jdbc:oracle:thin:@192.1.200.32:1521:orcl
385 [main] INFO connection.DriverManagerConnectionProvider - connection properties: {user=student, password=****}
3358 [main] INFO cfg.SettingsFactory - RDBMS: Oracle, version: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
3363 [main] INFO cfg.SettingsFactory - JDBC driver: Oracle JDBC driver, version: 10.2.0.1.0XE
3385 [main] INFO dialect.Dialect - Using dialect: org.hibernate.dialect.OracleDialect
3435 [main] INFO transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
3440 [main] INFO transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
3442 [main] INFO cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
3443 [main] INFO cfg.SettingsFactory - Automatic session close at end of transaction: disabled
3443 [main] INFO cfg.SettingsFactory - JDBC batch size: 15
3444 [main] INFO cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
3446 [main] INFO cfg.SettingsFactory - Scrollable result sets: enabled
3447 [main] INFO cfg.SettingsFactory - JDBC3 getGeneratedKeys(): disabled
3448 [main] INFO cfg.SettingsFactory - Connection release mode: auto
3450 [main] INFO cfg.SettingsFactory - Default batch fetch size: 1
3451 [main] INFO cfg.SettingsFactory - Generate SQL with comments: disabled
3452 [main] INFO cfg.SettingsFactory - Order SQL updates by primary key: disabled
3453 [main] INFO cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
3457 [main] INFO ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
3458 [main] INFO cfg.SettingsFactory - Query language substitutions: {}
3459 [main] INFO cfg.SettingsFactory - JPA-QL strict compliance: disabled
3460 [main] INFO cfg.SettingsFactory - Second-level cache: enabled
3460 [main] INFO cfg.SettingsFactory - Query cache: disabled
3461 [main] INFO cfg.SettingsFactory - Cache provider: org.hibernate.cache.NoCacheProvider
3463 [main] INFO cfg.SettingsFactory - Optimize cache for minimal puts: disabled
3464 [main] INFO cfg.SettingsFactory - Structured second-level cache entries: disabled
3472 [main] INFO cfg.SettingsFactory - Statistics: disabled
3473 [main] INFO cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
3474 [main] INFO cfg.SettingsFactory - Default entity-mode: pojo
3475 [main] INFO cfg.SettingsFactory - Named query checking : enabled
6360 [main] INFO impl.SessionFactoryImpl - building session factory
6374 [main] INFO impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
Exception in thread "main" org.hibernate.MappingException: Unknown entity: javaapplication42.Employee
at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:550)
at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1338)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:98)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301)
at $Proxy0.save(Unknown Source)
at javaapplication42.Example1.main(Example1.java:25)
Java Result: 1
BUILD SUCCESSFUL (total time: 9 seconds)
Code:
[/quote]