Projection on properties from embedded types returns String rather than the mapped type

Description

Before HSearch 5 projecting on post.id returned a long. Now it returns a string. It might because the @Field approach I use is no longer valid. Please advise.

public class WallPost{ @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "postId", updatable = false, insertable = false) //Storing the id to deal with https://blog.trifork.com/2012/01/22/query-time-joining-in-lucene/ @Field(name="baseCommentId",index=Index.YES,store=Store.YES,analyze=Analyze.NO,bridge=@FieldBridge(impl=LongBridge.class)) @DocumentId public Long getId() { return id; } @ManyToOne(fetch=FetchType.LAZY,optional=true) @JoinColumn(name="FK_PostId",nullable=true,insertable=true,updatable=false) @IndexedEmbedded(includePaths={"id","type","baseCommentId"},indexNullAs=Field.DEFAULT_NULL_TOKEN) @ContainedIn public WallPost getPost() { return post; }
.createFullTextQuery( mj.createQuery(), WallPost.class) .setProjection(ProjectionConstants.ID, "post.id")

Activity

Sanne GrinoveroMarch 3, 2015 at 10:27 AM

Thanks , , !
It's merged. I'll release it later today.

Sanne GrinoveroMarch 3, 2015 at 10:24 AM

RustemSMarch 3, 2015 at 5:46 AM

we also don't get any exception. Everything works fine. Thanks!

Marc SchipperheynMarch 3, 2015 at 2:02 AM

Ok, had a go. At first glance, can't reproduce the exception anymore. Of course, it was now you see me, now you don't. But it did show up regularly and I don't see it at all anymore. This means I can start spending energy again on working with HSEARCH 5. Thx! If the problem occurs again, I will report it.

Sanne GrinoveroMarch 3, 2015 at 12:06 AM

yes it is. I just gave the full link because one never knows "which" snapshot it is consuming, feedback is sometimes a bit confusing 😉 Thanks!

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Created January 29, 2015 at 3:34 AM
Updated October 31, 2017 at 12:33 PM
Resolved March 3, 2015 at 10:25 AM

Flag notifications