[hibernate-issues] [Hibernate-JIRA] Assigned: (HSEARCH-979) Programmatic API: mapping a composite primary key

Sanne Grinovero (JIRA) noreply at atlassian.com
Tue Apr 3 12:36:48 EDT 2012


     [ https://hibernate.onjira.com/browse/HSEARCH-979?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sanne Grinovero reassigned HSEARCH-979:
---------------------------------------

    Assignee: Sanne Grinovero

> Programmatic API: mapping a composite primary key
> -------------------------------------------------
>
>                 Key: HSEARCH-979
>                 URL: https://hibernate.onjira.com/browse/HSEARCH-979
>             Project: Hibernate Search
>          Issue Type: Bug
>          Components: mapping
>    Affects Versions: 3.3.0.Final, 3.4.1.Final
>         Environment: Hibernate 3.6 Final
>            Reporter: Fuessmann
>            Assignee: Sanne Grinovero
>             Fix For: 4.1.0.Final
>
>
> Hallo, I'm using Hibernate Search in combination with the [b]Programmatic API[/b] for dynamic indexing. Is there any possibility to index an entity with an composite primary key annotated with [b]@EmbeddedId[/b]. 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. 
> {quote}
> ...
> @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;
> ...
> 	}
> {quote}
> Code for ABridge.class is not shown but still exists ..
> I try a code like this, but the code does not work:
> {quote}
> mapping.entity(A.class).indexed().indexName("a")
> .property("id", ElementType.METHOD).documentId().field().bridge(ABridge.class)
> {quote}
> Exception occurred during event dispatching:
> {quote}
> org.hibernate.HibernateException: [color=#FF0000]could not init listeners{color} 
> ...
> Caused by: org.hibernate.search.SearchException: {color:red} Unable to guess FieldBridge for id{color} 
> ...
> {quote}
> I need an advise to solve my problem. Thanks

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list