Org.ejb3unit.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany

4 respostas
davelino

Retirado o problema por direitos maiores.

Agradeço a ajuda de todos

4 Respostas

ignacio83

Essas classes estão sendo apontados no arquivo persistence.xml (se for JPA) ou no hibernate.cfg.xml (se for Hibernate puro)?

davelino

Configura ção do meu persistence.xml, onde SIGEM001JPA e o projeto

<?xml version=“1.0” encoding=“UTF-8”?>
<persistence version=“1.0” xmlns=“http://java.sun.com/xml/ns/persistence” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=“http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd”>
<persistence-unit name=“SIGEM001JPA”>
</persistence-unit>
</persistence>

ignacio83

Faça assim:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlnssi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="SIGEM001JPA">
<class>biz.remanso.sige.domain.entities.AccountPlan</class>
<class>biz.remanso.sige.domain.entities.AccountBalance</class>
...
...
...
</persistence-unit>
</persistence>

Percebi agora que vc está tentanto utilizaro EJB3Unit, também tive esse mesmo tipo de problema… Tive que colocar tudo no persistence.xml

davelino

Coloquei e ficou assim:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"&gt; &lt;persistence-unit name="SIGEM001JPA"&gt; &lt;class&gt;biz.remanso.sige.domain.entities.AccountBalance&lt;/class&gt; &lt;class&gt;biz.remanso.sige.domain.entities.AccountingUser&lt;/class&gt; &lt;class&gt;biz.remanso.sige.domain.entities.AccountPlan&lt;/class&gt; &lt;class&gt;biz.remanso.sige.domain.entities.CostCenter&lt;/class&gt; &lt;class&gt;biz.remanso.sige.domain.entities.Launching&lt;/class&gt; &lt;class&gt;biz.remanso.sige.domain.entities.LaunchingItem&lt;/class&gt; &lt;class&gt;biz.remanso.sige.domain.entities.MonthlyBalanceSheet&lt;/class&gt; &lt;class&gt;biz.remanso.sige.domain.entities.Record&lt;/class&gt; &lt;/persistence-unit&gt; &lt;/persistence&gt;

So que continuou com o mesmo problema.

Criado 24 de junho de 2009
Ultima resposta 24 de jun. de 2009
Respostas 4
Participantes 2