Pessoal comecei estudar hibernate ontem, estou com pequeno problema.
Está dando esse erro na compilação!!
Out 03, 2012 5:48:37 PM org.hibernate.annotations.common.Version
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
Out 03, 2012 5:48:37 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.1.6.Final}
Out 03, 2012 5:48:37 PM org.hibernate.cfg.Environment
INFO: HHH000206: hibernate.properties not found
Out 03, 2012 5:48:37 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Out 03, 2012 5:48:37 PM org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
Out 03, 2012 5:48:37 PM org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
Out 03, 2012 5:48:37 PM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
Out 03, 2012 5:48:37 PM org.hibernate.cfg.Configuration doConfigure
INFO: HHH000041: Configured SessionFactory: null
Out 03, 2012 5:48:38 PM org.hibernate.mapping.RootClass checkCompositeIdentifier
WARN: HHH000038: Composite-id class does not override equals(): aluno
Out 03, 2012 5:48:38 PM org.hibernate.mapping.RootClass checkCompositeIdentifier
WARN: HHH000039: Composite-id class does not override hashCode(): aluno
Exception in thread “main” org.hibernate.MappingException: Composite-id class must implement Serializable: aluno
at org.hibernate.mapping.RootClass.checkCompositeIdentifier(RootClass.java:290)
at org.hibernate.mapping.RootClass.validate(RootClass.java:279)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1294)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1738)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1784)
at GravaAluno.main(GravaAluno.java:16)
//
XML para configuraçao
<?xml version="1.0" encoding="UTF-8"?> <property name ="connection.Driver_class"> org.postgresql.Driver</property>
<property name ="connection.url">jdbc:postgresql://localhost/JavaHibernate </property>
<property name = "connection.username"> postgres</property>
<property name = "connection.password">root</property>
<property name ="connection.pool_size">1</property>
<property name = "dialect"> org.hibernate.dialect.PostgreSQLDialect</property>
<property name="show_sql">true</property>
<mapping class="aluno"></mapping>
Abaixo segue As class, Utilizando Banco Postgresql, com todas as columun criadas.