[Hibernate-JIRA] Created: (HHH-5653) Problem setting parameter of NamedQuery via index/value args
by Tonté Pouncil (JIRA)
Problem setting parameter of NamedQuery via index/value args
------------------------------------------------------------
Key: HHH-5653
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5653
Project: Hibernate Core
Issue Type: Bug
Components: query-hql
Affects Versions: 3.5.1
Environment: Windows XP, Oracle 10g
Reporter: Tonté Pouncil
See Hibernate Form Topic: https://forum.hibernate.org/viewtopic.php?f=1&t=1007516
I am using Hibernate-core 3.5.1-Final. I have a named query defined in my entity class. Later in my Generic DAO logic, I use the Query API to dynamically look up the named query from the session and then set the parameters on the query.
Code:
@SuppressWarnings("unchecked")
private Map<String, Object> getNamedQueryParameters(final String namedQueryName, Object[] queryArgs) {
System.out.println("GenericDaoHibernateJpa.getNamedQueryParameters(): namedQueryName: " + namedQueryName);
StringBuffer queryArgsString = new StringBuffer();
int qaIndex = 0;
for(Object qa: queryArgs){
queryArgsString.append("GenericDaoHibernateJpa.getNamedQueryParameters(): queryArgs("+(qaIndex++)+"):" + qa.toString() + "\n");
}
System.out.println("GenericDaoHibernateJpa.getNamedQueryParameters(): Query Arguements: " + queryArgsString.toString());
Map<String, Object> namedQueryParams = Collections.synchronizedMap(new HashMap<String, Object>());
final QueryImpl<?> namedQuery = (QueryImpl<?>) getJpaTemplate().execute(new JpaCallback(){
public Object doInJpa(EntityManager em) {
return em.createNamedQuery(namedQueryName);
}
});
System.out.println("GenericDaoHibernateJpa.getNamedQueryParameters(): assigning parameters.");
int i = 0;
for(Object arguement: queryArgs){
namedQuery.setParameter(i++, arguement);
}
for(String namedQueryParamString: namedQuery.getHibernateQuery().getNamedParameters()){
System.out.println("GenericDaoHibernateJpa.getNamedQueryParameters(): " + namedQueryParamString + "=" + namedQuery.getParameterValue(namedQueryParamString));
namedQueryParams.put(namedQueryParamString, namedQuery.getParameterValue(namedQueryParamString));
}
System.out.println("GenericDaoHibernateJpa.getNamedQueryParameters(): end result: " + namedQueryParams);
return namedQueryParams;
}
I get the following error message:
Code:
java.lang.IllegalArgumentException: org.hibernate.QueryParameterException: Position beyond number of declared ordinal parameters. Remember that ordinal parameters are 1-based! Position: 0
at org.hibernate.ejb.QueryImpl.setParameter(QueryImpl.java:435)
at org.generic.dao.aop.persistence.core.dao.GenericDaoHibernateJpa.getNamedQueryParameters(GenericDaoHibernateJpa.java:245)
at org.generic.dao.aop.persistence.core.dao.GenericDaoHibernateJpa.executeFinder(GenericDaoHibernateJpa.java:187)
at org.generic.dao.aop.persistence.core.dao.finder.FinderIntroductionInterceptor.invoke(FinderIntroductionInterceptor.java:32)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy30.findProfileWithExpiredPassword(Unknown Source)
at com.aviall.pw.manager.core.dao.TestPasswordProfileDAO.testFindingExpiredPassword(TestPasswordProfileDAO.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:44)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
Caused by: org.hibernate.QueryParameterException: Position beyond number of declared ordinal parameters. Remember that ordinal parameters are 1-based! Position: 0
at org.hibernate.engine.query.ParameterMetadata.getOrdinalParameterDescriptor(ParameterMetadata.java:81)
at org.hibernate.engine.query.ParameterMetadata.getOrdinalParameterExpectedType(ParameterMetadata.java:87)
at org.hibernate.impl.AbstractQueryImpl.determineType(AbstractQueryImpl.java:445)
at org.hibernate.impl.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:417)
at org.hibernate.ejb.QueryImpl.setParameter(QueryImpl.java:429)
... 41 more
I've been looking at the JPA code from Hibernate and there seem to a problem with the QueryImpl class.
Code:
public TypedQuery<X> setParameter(int position, Object value) {
try {
if ( isJpaPositionalParameter( position ) ) {
this.setParameter( Integer.toString( position ), value );
}
else {
query.setParameter( position - 1, value );
registerParameterBinding( getParameter( position ), value );
}
return this;
}
catch (QueryParameterException e) {
throw new IllegalArgumentException( e );
}
catch (HibernateException he) {
throw getEntityManager().convert( he );
}
}
Which calls the AbstractQueryImpl.setParameter(int position, Object val) method:
Code:
public Query setParameter(int position, Object val) throws HibernateException {
if (val == null) {
setParameter( position, val, Hibernate.SERIALIZABLE );
}
else {
setParameter( position, val, determineType( position, val ) );
}
return this;
}
Which calls the AbstractQueryImpl.determineType(int paramPosition, Object paramValue) method:
Code:
protected Type determineType(int paramPosition, Object paramValue) throws HibernateException {
Type type = parameterMetadata.getOrdinalParameterExpectedType( paramPosition + 1 );
if ( type == null ) {
type = guessType( paramValue );
}
return type;
}
Which uses the Ordinal to determine the ordinal expected type. But instead of return null, this method throws the above exception. See ParameterMetadata.getOrdinalParameterExpectedType(int position) method.
Code:
public OrdinalParameterDescriptor getOrdinalParameterDescriptor(int position) {
if ( position < 1 || position > ordinalDescriptors.length ) {
String error = "Position beyond number of declared ordinal parameters. " +
"Remember that ordinal parameters are 1-based! Position: " + position;
throw new QueryParameterException( error );
}
return ordinalDescriptors[position - 1];
}
public Type getOrdinalParameterExpectedType(int position) {
return getOrdinalParameterDescriptor( position ).getExpectedType();
}
Lastly, I found that the QueryTranslatorImpl.getWalker() returns a walker with a positionalParameterCount of 0 (zero) and parameterCount of 3 (three); which seem to be the root of the problem. Because when the HQLQueryPlan build the parameter meta data via the buildParameterMetaData() method the ordinalParamCount is 0 (zero). However the recognizer.getNamedParameterDescriptionMap() return 3 (three) entries for the 3 (three) parameters. It seems to me the ordinalParamCount should be overridden to include these 3 (three) entries from the recognizer.getNamedParameterDescriptionMap().
Code:
private ParameterMetadata buildParameterMetadata(ParameterTranslations parameterTranslations, String hql) {
long start = System.currentTimeMillis();
ParamLocationRecognizer recognizer = ParamLocationRecognizer.parseLocations( hql );
long end = System.currentTimeMillis();
if ( log.isTraceEnabled() ) {
log.trace( "HQL param location recognition took " + (end - start) + " mills (" + hql + ")" );
}
int ordinalParamCount = parameterTranslations.getOrdinalParameterCount();
int[] locations = ArrayHelper.toIntArray( recognizer.getOrdinalParameterLocationList() );
if ( parameterTranslations.supportsOrdinalParameterMetadata() && locations.length != ordinalParamCount ) {
throw new HibernateException( "ordinal parameter mismatch" );
}
ordinalParamCount = locations.length;
OrdinalParameterDescriptor[] ordinalParamDescriptors = new OrdinalParameterDescriptor[ordinalParamCount];
for ( int i = 1; i <= ordinalParamCount; i++ ) {
ordinalParamDescriptors[ i - 1 ] = new OrdinalParameterDescriptor(
i,
parameterTranslations.supportsOrdinalParameterMetadata()
? parameterTranslations.getOrdinalParameterExpectedType( i )
: null,
locations[ i - 1 ]
);
}
Iterator itr = recognizer.getNamedParameterDescriptionMap().entrySet().iterator();
Map namedParamDescriptorMap = new HashMap();
while( itr.hasNext() ) {
final Map.Entry entry = ( Map.Entry ) itr.next();
final String name = ( String ) entry.getKey();
final ParamLocationRecognizer.NamedParameterDescription description =
( ParamLocationRecognizer.NamedParameterDescription ) entry.getValue();
namedParamDescriptorMap.put(
name,
new NamedParameterDescriptor(
name,
parameterTranslations.getNamedParameterExpectedType( name ),
description.buildPositionsArray(),
description.isJpaStyle()
)
);
}
return new ParameterMetadata( ordinalParamDescriptors, namedParamDescriptorMap );
}
So is this a bug?
How do I ensure the ParameterMetadata is set correctly with the appropriate values; so the ParameterMetadata.getOrdinalParameterExpectedType(int position) method can stop throwing the above exception?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[Hibernate-JIRA] Updated: (HHH-993) Criteria subquery without projection fails throwing NullPointerException
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-993?page=co... ]
Emmanuel Bernard updated HHH-993:
---------------------------------
Comment: was deleted
(was: [cheap airline tickets|http://getflightsto.com]
[Parenting|http://childcareforums.com]
)
> Criteria subquery without projection fails throwing NullPointerException
> ------------------------------------------------------------------------
>
> Key: HHH-993
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-993
> Project: Hibernate Core
> Issue Type: Improvement
> Components: core
> Reporter: Johannes Rudolph
> Priority: Minor
>
> If you use a subquery in a criteria query and there is no projection, the execution of the query will fail by throwing a NullPointerException:
> Caused by: java.lang.NullPointerException
> at
> org.hibernate.loader.criteria.CriteriaQueryTranslator.getProjectedTypes(Crit
> eriaQueryTranslator.java:298)
> at
> org.hibernate.criterion.SubqueryExpression.toSqlString(SubqueryExpression.ja
> va:56)
> at
> org.hibernate.criterion.LogicalExpression.toSqlString(LogicalExpression.java
> :39)
> org.hibernate.loader.criteria.CriteriaQueryTranslator.getWhereCondition(Crit
> eriaQueryTranslator.java:314)
> ...
> I think it is expected behaviour that restrictions only work on 1-dimensional return values of subqueries so it would be nice if Hibernate would mention that somewhere.
> It would be nice if you could just write:
> Criteria crit = dbSession.createCriteria(Bla.class);
> DetachedCriteria detachedCrit = DetachedCriteria.forClass(Blub.class).add( Restrictions.eq("condition", Boolean.FALSE));
> crit.add( Restrictions.or( Restrictions.isNull("superBlub"),
> Subqueries.in("superBlub", detachedCrit ) ) );
> since Hibernate entities could be seen as "entities" so Hibernate should automatically transform it into:
> DetachedCriteria detachedCrit = DetachedCriteria.forClass(Blub.class).add( Restrictions.eq("condition", Boolean.FALSE))
> .setProjection( Projections.id() );
> crit.add( Restrictions.or( Restrictions.isNull("superBlub"),
> Subqueries.propertyIn("ueberPartner", detachedCrit ) ) );
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[Hibernate-JIRA] Created: (HHH-4072) ManyToMany with single table inheritance fails when multiple subclasses
by david sinclair (JIRA)
ManyToMany with single table inheritance fails when multiple subclasses
-----------------------------------------------------------------------
Key: HHH-4072
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4072
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.3.2
Environment: Windows XP, Java 1.6
Reporter: david sinclair
Priority: Critical
I have a base entity named BusinessSoftwareMatrixElement declare as such
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "software_type", discriminatorType = DiscriminatorType.STRING)
@DiscriminatorValue("Software")
@Audited
BusinessSoftwareMatrixElement ...{ }
I then have a subclass of BusinessSoftwareMatrixElement that is a mapped super class which defines a many to many relationship.
@MappedSuperclass
@Audited
public abstract class BusinessOSProcessServiceMatrixElement extends BusinessSoftwareMatrixElement {
private Set<BusinessOSMatrixElement> applicableOperatingSystems = new HashSet<BusinessOSMatrixElement>();
@ManyToMany(fetch = FetchType.LAZY, cascade = {CascadeType.REMOVE, CascadeType.REFRESH }, targetEntity = BusinessOSMatrixElement.class)
@JoinTable(name="matrix_elements_procserv_aos",
joinColumns=@JoinColumn(name="sw_guid"),
inverseJoinColumns = @JoinColumn(name="os_guid"))
public Set<BusinessOSMatrixElement> getApplicableOperatingSystems() {
return applicableOperatingSystems;
}
}
There are then to subclasses that add no new fields, only different discriminators
@Entity
@DiscriminatorValue("Database")
@Audited
public class BusinessDBMatrixElement extends BusinessOSProcessServiceMatrixElement {
@Entity
@DiscriminatorValue("Application")
@Audited
public class BusinessAppMatrixElement extends BusinessOSProcessServiceMatrixElement {
Running the ant task to create the DDL results in an exception being thrown for that many to many table.
Caused by: org.hibernate.DuplicateMappingException: Duplicate class/entity mapping matrix_elements_procserv_aos_AUD
at org.hibernate.tool.ant.HibernateToolTask.reportException(HibernateToolTask.java:226)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:189)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
... 24 more
Caused by: org.hibernate.DuplicateMappingException: Duplicate class/entity mapping matrix_elements_procserv_aos_AUD
at org.hibernate.cfg.Mappings.addClass(Mappings.java:141)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:167)
at org.hibernate.cfg.Configuration.add(Configuration.java:716)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:531)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:291)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1162)
at org.hibernate.envers.configuration.AuditConfiguration.getFor(AuditConfiguration.java:102)
at org.hibernate.envers.ant.AnnotationConfigurationTaskWithEnvers.doConfiguration(AnnotationConfigurationTaskWithEnvers.java:38)
at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:55)
at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:302)
at org.hibernate.tool.ant.Hbm2DDLExporterTask.createExporter(Hbm2DDLExporterTask.java:51)
at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[Hibernate-JIRA] Created: (HHH-2835) Setting org.hibernate.type logging to debug produces no logging
by Jeremy Grodberg (JIRA)
Setting org.hibernate.type logging to debug produces no logging
---------------------------------------------------------------
Key: HHH-2835
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2835
Project: Hibernate3
Issue Type: Bug
Components: core, documentation
Affects Versions: 3.2.5, 3.2.4
Environment: Hibernate 3.2.4.ga and Hibernate 3.2.5.ga with MySQL5Dialect (configured with Hibernate Annotations 3.3.0.ga and Spring 2.0.6)
Reporter: Jeremy Grodberg
Priority: Minor
According to the online documentation (labeled as version 3.2.2 at this moment), Table 3.9 "Hibernate Log Categories", as viewed here today:
http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat...
Setting the log4j category "org.hibernate.type" to debug should "Log all JDBC parameters". However, it produces no output at all.
When I go on to set "org.hibernate" to debug, I get output like this:
DEBUG: org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
DEBUG: org.hibernate.SQL - select count(*) from album where genreID=?
DEBUG: org.hibernate.loader.Loader - bindNamedParameters() 126 -> genreId [1]
DEBUG: org.hibernate.jdbc.AbstractBatcher - about to open ResultSet (open ResultSets: 0, globally: 0)
DEBUG: org.hibernate.loader.Loader - result row:
DEBUG: org.hibernate.jdbc.AbstractBatcher - about to close ResultSet (open ResultSets: 1, globally: 1)
DEBUG: org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
Note that the JDBC parameters are logged under org.hibernate.loader but nothing appears under org.hibernate.type. FYI, genreId is, in this case, a Long.
Perhaps this is expected/desired when using annotations? If so, then please update the documentation. If not, please restore the logging.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[Hibernate-JIRA] Created: (HHH-2228) ant eg fails - bad release notes quick start
by Brian Brooks (JIRA)
ant eg fails - bad release notes quick start
--------------------------------------------
Key: HHH-2228
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2228
Project: Hibernate3
Type: Bug
Components: documentation
Versions: 3.2.0.ga
Environment: hibernate 3.2.0.ga
Microsoft Windows XP [Version 5.1.2600]
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode)
Reporter: Brian Brooks
Priority: Minor
The hibernate 3.2.0.ga release notes
http://sourceforge.net/project/shownotes.php?release_id=455849&group_id=4...
read as
Get Up And Running Quick
------------------------
Demo:
(1) copy your JDBC driver to the lib directory
(2) edit etc/hibernate.properties
(3) run "ant eg" or "build eg"
(4) browse the sourcecode in eg/org/hibernate/auction
This directions are incorrect. Below is the ant output if these steps are followed. Also, I had to put junit*.jar and antlr*all*.jar in my ANT_HOME/lib before ant eg would work.
C:\hibernate-3.2>ant eg
Buildfile: build.xml
[taskdef] Could not load definitions from resource clovertasks. It could not b
e found.
eg:
[javac] Compiling 8 source files to C:\hibernate-3.2\build\eg
[javac] C:\hibernate-3.2\eg\org\hibernate\auction\Main.java:10: cannot find
symbol
[javac] symbol : class FetchMode
[javac] location: package org.hibernate
[javac] import org.hibernate.FetchMode;
[javac] ^
[javac] C:\hibernate-3.2\eg\org\hibernate\auction\Main.java:11: cannot find
symbol
[javac] symbol : class FlushMode
[javac] location: package org.hibernate
[javac] import org.hibernate.FlushMode;
[javac] ^
[javac] C:\hibernate-3.2\eg\org\hibernate\auction\Main.java:12: cannot find
symbol
[javac] symbol : class LockMode
[javac] location: package org.hibernate
[javac] import org.hibernate.LockMode;
[javac] ^
....
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
13 years, 8 months
[Hibernate-JIRA] Created: (HSEARCH-572) a plea to reconsider deprecating luceneOptions.getStore(), luceneOptions.getIndex() etc
by Jason Eacott (JIRA)
a plea to reconsider deprecating luceneOptions.getStore(), luceneOptions.getIndex() etc
---------------------------------------------------------------------------------------
Key: HSEARCH-572
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-572
Project: Hibernate Search
Issue Type: Deprecation
Reporter: Jason Eacott
Maybe I'm missing something, but for a fieldBridge I've noticed that it is now recommended to use luceneOptions.addFieldToDocument in place of document.add(new Field...
This decision seems a bit overzealous and optimistic to me, especially given the current and significant lag in lucene version vs supported HibernateSearch version.
for example - if luceneOptions.getStore(), luceneOptions.getIndex() etc are not deprecated then I can easily use them to create a custom field bridge for field types unknown to hibernateSearch. While these methods remain it is very easy to create a dynamic MapBridge for example that can choose to index a Map's key value pairs as Text or NumericFields as appropriate (Since HSearch currently has no support for NumericFields this is very useful). Without these methods, the options are much more limited.
So I'd just like to ask that either these methods remain, or an alternate arrangement be made available whereby any lucene field type can be added to a document with suitable index, store, boost, termvector etc.
Cheers.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months