-->
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.  [ 2 posts ] 
Author Message
 Post subject: [Search] Programmatic API
PostPosted: Mon Jan 30, 2012 10:45 am 
Newbie

Joined: Wed Dec 07, 2011 5:27 am
Posts: 6
Hello

Currently we are using hibernate (jpa) and hibernate-search. I'm about to change from annotations to programmatic API and to stay typesafe i had the glorious idea, to use jpa metamodel...

So instead
Quote:
mapping.entity(Address.class).indexed().property("addressId", ElementType.METHOD).field();

something like
Quote:
mapping.entity(Address.class).indexed().property(Address_.addressId.getName(), ElementType.METHOD).field();


But sadly without success... Because setup needs SearchMapping a lot before StaticMetaModel classes gets initialized, I'm running into NPE.

Any idea how I can use programmatic API and stay typesafe? Any suggestion are welcome...


Top
 Profile  
 
 Post subject: Re: [Search] Programmatic API
PostPosted: Thu Feb 02, 2012 5:54 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

we have been thinking about a type safe way for the Search programatic API, but haven't so far looked further into it. As you say, using the JPA metamodel could be one way, but it won't work for all cases. You would really need a Search specific metamodel.

At the moment you cannot do much to stay type safe, unless you either populate the JPA metamodel classes yourself or you write your own annotation processor.

--Hardy


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.