Olá Pessoal
Tenho o seguinte mapeamento:
<http://www.javafree
1. <?xml version="1.0"
2. <!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/
"c://tmp//hibernate-
3. <hibernate-mapping>
4. <class name="br.uniritter.
"CONTEUDO_SECAO"
5. <composite-id>
6. <key-property name="idSecao" column="SECAO_
type="integer"
7. <key-property name="idConteudo" column=
"CONTEUDO_idCONTEUD
8. </composite-
9.
10. </class>
11. </hibernate-
<?xml version="1.0"
"-//Hibernate/
"c://tmp//hibernate-
name="br.uniritter.
table="CONTEUDO_
name="idSecao" column="SECAO_
<key-property name="idConteudo" column="CONTEUDO_
type="integer"
</hibernate-
estou tendo o seguinte problema:
Tenho os seguintes registros armazenados:
15 | 1 , 15 | 2 , 15 | 3 , 16 | 1 , 16 | 2 . Quando executo o código para
fazer a pesquisa:
<http://www.javafree
1. super.openSession(
2. transaction = (Transaction) session.beginTransa
3.
4.
Criteria criterio = session.createCrite
class);
5.
6. List listAssociacoes = criterio.list(
super.openSession(
session.beginTransa
session.createCrite
List listAssociacoes = criterio.list(
no listAssociacoes vem da seguinte maneira:
3 registros 15 | 1 e 2 Registros 16 | 1.
No banco de dados a tabela está criada como chave primária composta onde os
dois campos são chave.
ahhh no log do Hibernate aparece a seguinte informação:
2009-04-06 01:06:53,609 INFO hibernate.cfg.
final
2009-04-06 01:06:53,609 INFO hibernate.cfg.
properties from resource hibernate.propertie
{hibernate.connecti
hibernate.cglib.
hibernate.dialect=
hibernate.connectio
hibernate.connectio
2009-04-06 01:06:53,609 INFO hibernate.cfg.
reflection optimizer
2009-04-06 01:06:53,625 INFO hibernate.cfg.
resource: br/uniritter/
2009-04-06 01:06:54,171 INFO hibernate.cfg.
br.uniritter.
2009-04-06 01:06:54,265 DEBUG hibernate.cfg.
idSecao -> SECAO_ID_SECAO, type: integer
2009-04-06 01:06:54,265 DEBUG hibernate.cfg.
idConteudo -> CONTEUDO_idCONTEUDO
2009-04-06 01:06:54,468 INFO hibernate.cfg.
one-to-many association mappings
2009-04-06 01:06:54,468 INFO hibernate.cfg.
one-to-one association property references
2009-04-06 01:06:54,468 INFO hibernate.cfg.
foreign key constraints
2009-04-06 01:06:54,500 WARN hibernate.cfg.
dialect set - using GenericDialect: Dialect class not found:
net.sf.hibernate.
2009-04-06 01:06:54,500 INFO hibernate.dialect.
dialect: net.sf.hibernate.
2009-04-06 01:06:54,500 INFO hibernate.cfg.
outer join fetching: false
2009-04-06 01:06:54,500 INFO
hibernate.connectio
built-in connection pool (not for production use!)
2009-04-06 01:06:54,500 INFO
hibernate.connectio
connection pool size: 20
2009-04-06 01:06:54,515 INFO
hibernate.connectio
com.mysql.jdbc.
2009-04-06 01:06:54,515 INFO
hibernate.connectio
properties: {user=root, password=root}
2009-04-06 01:06:54,515 INFO
hibernate.transacti
TransactionManagerL
level read-write cache is not recommended)
2009-04-06 01:06:54,515 DEBUG
hibernate.connectio
connections: 0
2009-04-06 01:06:54,515 DEBUG
hibernate.connectio
connection
2009-04-06 01:06:54,718 DEBUG
hibernate.connectio
to: jdbc:mysql://localhost:
2009-04-06 01:06:54,718 DEBUG
hibernate.connectio
connection to pool, pool size: 1
2009-04-06 01:06:54,718 INFO hibernate.cfg.
scrollable result sets: true
2009-04-06 01:06:54,718 INFO hibernate.cfg.
language substitutions: {}
2009-04-06 01:06:54,718 INFO hibernate.cfg.
provider: net.sf.ehcache.
2009-04-06 01:06:54,734 INFO hibernate.cfg.
instantiating and configuring caches
2009-04-06 01:06:54,750 INFO hibernate.impl.
building session factory
2009-04-06 01:06:54,750 DEBUG hibernate.impl.
instantiating session factory with properties: {java.runtime.
SE Runtime Environment, hibernate.connectio
sun.boot.library.
java.vm.version=
java.vm.vendor=
path.separator=
file.encoding.
sun.os.patch.
Machine Specification, user.dir=D:\
Reis\Sistemas de Informação\Projeto Final de Curso
2\Implementaçã
java.awt.graphicsen
java.endorsed.
programas\Java\
java.io.tmpdir=
, java.vm.specificati
os.name=Windows
XP, sun.jnu.encoding=
programas\Java\
files\SAP\IDE\
d:\atalhos;"
java.specification.
java.class.version=
os.version=5.
user.timezone=
java.awt.printerjob
java.specification.
hibernate.connectio
java.class.path=
Informação\Projeto Final de Curso
2\Implementaçã
programas\Tomcat\
programas\Tomcat\
programas\Tomcat\
programas\Tomcat\
programas\Tomcat\
programas\Tomcat\
programas\Tomcat\
programas\Tomcat\
programas\Tomcat\
dos Reis\Sistemas de Informação\Projeto Final de Curso
2\Implementaçã
dos Reis\Sistemas de Informação\Projeto Final de Curso
2\Implementaçã