Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Hibernate Search:Programmatic API and @EmbeddedId
PostPosted: Sat Nov 19, 2011 11:31 am 
Newbie

Joined: Sat Nov 19, 2011 11:19 am
Posts: 4
Hallo, I'm using Hibernate Search in combination with the Programmatic API for dynamic indexing. Is there any possibility to index an entity with an composite primary key annotated with @EmbeddedId. Using H.Search without the Programmatic API i choose a TwoWayFieldBridge but how can I use it with the Programmatic API?

In my case I am trying to implement a programmatic mapping for an entity. The entity has an an composite primary key annotated with @EmbeddedId.

Code:
...
@Entity(name = "a")
@Table(name = "a")
public class A implements java.io.Serializable {

...   

@EmbeddedId
   @AttributeOverrides( {
         @AttributeOverride(name = "name_1", column = @Column(name = "name_1", nullable = false, length = 64)),
         @AttributeOverride(name = "name_2", column = @Column(name = "name_2", nullable = false, length = 16)) })
   public AId getId() {
      return this.id;

...
   }


Code for ABridge.class is not shown but still exists ..

I try a code like this, but the code does not work:

Code:
mapping.entity(A.class).indexed().indexName("a")
.property("id", ElementType.METHOD).documentId().field().bridge(ABridge.class)


Exception occurred during event dispatching:
org.hibernate.HibernateException: could not init listeners
...
Caused by: org.hibernate.search.SearchException: Unable to guess FieldBridge for id
...


I need an advise to solve my problem. Thanks


Last edited by AG_Bi on Mon Nov 21, 2011 10:36 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Hibernate Search:Programmatic API and @EmbeddedId
PostPosted: Mon Nov 21, 2011 9:54 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2296
Location: Third rock from the Sun
Hi AG_Bi,
it's possible that this is not supported yet by the programmatic API; could you open an issue? I'll look into it, hopefully this week.
Ideally if you could create a unit test that would speed up things a lot.

https://hibernate.onjira.com/browse/HSEARCH

thanks

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Hibernate Search:Programmatic API and @EmbeddedId
PostPosted: Fri Dec 16, 2011 11:07 am 
Newbie

Joined: Sat Nov 19, 2011 11:19 am
Posts: 4
Now I migrate to HS 4.0.0 Final but the same Problem.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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.