You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@deltaspike.apache.org by Vladimir Albis Arandia <al...@saguapac.com.bo> on 2017/11/13 18:18:25 UTC

Cannot persist entities when adding AbstractEntityRepository

Hello


I have a ManyToMany relationship between three entities: Invoice, Product, InvoiceProduct, mapped with OneToMany bidirectional.


Entity: Invoice

Attribute: OneToMany InvoiceProduct


Entity: Product

Attribute: OneToMany InvoiceProduct


Entity: InvoiceProduct

Attribute: ManyToOne Invoice

Attribute: ManyToOne Product

Attribute: EmbeddedId InvoiceProductId


Also Invoice has an attribute annotated with @Version.


Now everything works as it should when using pure EJB JPA (Hibernate) with H2 database. But i get the following exception:


org.hibernate.PropertyAccessException: Could not set field value [SHORT_CIRCUIT_INDICATOR] value by reflection : [class bo.com.saguapac.eearchitect.InvoiceProductId.invoiceId] setter of bo.com.saguapac.eearchitect.InvoiceProductId.invoiceId


 When i add a Repository that extends AbstractEntityRepository for Invoice Entity.


Please , any advice would be appreciated.


Note: the environment is JBoss EAP 7, Java 8 update 101, Windows 10. Also if you want i can give you the maven project for testing.


bye,

Vladimir Albis Arandia
Telf. 3522323 Int. 568
Desarrollo de Aplicaciones
Gerencia General

Re: Cannot persist entities when adding AbstractEntityRepository

Posted by "John D. Ament" <jo...@apache.org>.
Hi,

A testable project would be very helpful here.

John

On Tue, Nov 14, 2017 at 3:13 AM Vladimir Albis Arandia <
albis.vladimir@saguapac.com.bo> wrote:

> Hello
>
>
> I have a ManyToMany relationship between three entities: Invoice, Product,
> InvoiceProduct, mapped with OneToMany bidirectional.
>
>
> Entity: Invoice
>
> Attribute: OneToMany InvoiceProduct
>
>
> Entity: Product
>
> Attribute: OneToMany InvoiceProduct
>
>
> Entity: InvoiceProduct
>
> Attribute: ManyToOne Invoice
>
> Attribute: ManyToOne Product
>
> Attribute: EmbeddedId InvoiceProductId
>
>
> Also Invoice has an attribute annotated with @Version.
>
>
> Now everything works as it should when using pure EJB JPA (Hibernate) with
> H2 database. But i get the following exception:
>
>
> org.hibernate.PropertyAccessException: Could not set field value
> [SHORT_CIRCUIT_INDICATOR] value by reflection : [class
> bo.com.saguapac.eearchitect.InvoiceProductId.invoiceId] setter of
> bo.com.saguapac.eearchitect.InvoiceProductId.invoiceId
>
>
>  When i add a Repository that extends AbstractEntityRepository for Invoice
> Entity.
>
>
> Please , any advice would be appreciated.
>
>
> Note: the environment is JBoss EAP 7, Java 8 update 101, Windows 10. Also
> if you want i can give you the maven project for testing.
>
>
> bye,
>
> Vladimir Albis Arandia
> Telf. 3522323 Int. 568
> Desarrollo de Aplicaciones
> Gerencia General
>