-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Problem with user-defined type in a ManyToOne-mapping
PostPosted: Mon Jan 30, 2017 3:02 pm 
Newbie

Joined: Mon Jan 30, 2017 2:34 pm
Posts: 3
Hello,

I updated from 4.3.10 to 5.2.6 and changed from configuration files to jpa. The database is postgresql with tables that have array-columns. Therefore, I defined usertypes, e.g. a type IntegerArray.

An entity PrfgGruppe associated with a view consists of a many-to-one member:
Code:
   @ManyToOne (fetch = FetchType.EAGER)
   @JoinColumn (name = "prfggruppe_id", insertable = false, updatable = false, unique = true)
   @NotFound (action = NotFoundAction.IGNORE)
   private PrfgTermin  termin;

Amongst others the entity PrfgTermin consists of
Code:
   @Column (name = "gespeichert_am")
   private Timestamp   updatedAt;
   @Column (name = "num_anm")
   private Integer       numAnm;
   @Column (name = "raeume")
   @Type (type = "IntegerArray")
   private Integer[]    raeume;

Now, when objects of class PrfgGruppe are created by a native query together with a resultset mapping, the member of class PrfgTermin in PrfgGruppe is populated with members of basic types only (e.g. updatedAt). The member raeume is not set.

Where's my mistake?

Thank you
Andreas


Top
 Profile  
 
 Post subject: Re: Problem with user-defined type in a ManyToOne-mapping
PostPosted: Tue Jan 31, 2017 4:08 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1638
Location: Romania
Maybe it's a bug so, if you can provide a replicating test case, then you should open a Jira issue.

_________________
If you liked my answer, you are going to love my High-Performance Java Persistence book and my blog as well.


Top
 Profile  
 
 Post subject: Re: Problem with user-defined type in a ManyToOne-mapping
PostPosted: Wed Feb 01, 2017 2:54 am 
Newbie

Joined: Mon Jan 30, 2017 2:34 pm
Posts: 3
Thank you.
I understand your answer that basically my intentions are expressed properly by the annotations.
I cut down the complexity strongly and prepared a test case.
Unfortunately, the effect cannot be observed.
I will have a closer look at logs and traces.


Top
 Profile  
 
 Post subject: Re: Problem with user-defined type in a ManyToOne-mapping
PostPosted: Wed Feb 01, 2017 3:07 pm 
Newbie

Joined: Mon Jan 30, 2017 2:34 pm
Posts: 3
My mistake has been that in the nullSafeGet-method of the user-type I did not called a getter before calling wasNull on the resultset-argument.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.