IRC meeting 6/7
by Steve Ebersole
Here are the notes from todays meeting. Thanks to Hans and Jason for
joining and answering Gradle questions.
--
Steve Ebersole <steve(a)hibernate.org>
http://hibernate.org
14 years, 7 months
[HSEARCH] Breaking some contracts
by Emmanuel Bernard
Hi guys
I've been working on HSEARCH-397 lately.
I had to do HSEARCH-541. I had to change the initialize contract of many SPIs:
- ReaderProvider
- Worker
- DirectoryProvider
- BackendQueueProcessorFactory
- OptimizerStrategy
The idea is to pass a BuildContext, WritableBuildContect and WorkerBuildContext object to initialize and containing a subset of the SearchFactoryImplementor contract.
For services that require a reference to the SFI, I've provided an getUnititializedSearchFactoryImplementor() whose object cannot be used until after initialize is done.
The bad news is that it breaks some semi public contracts. The good news is that it opens the doors to:
- create a SearchFactoryBuilder (that will help solve HSEARCH-397)
- make SearchFactoryImpl immutable (Sanne will like it)..
What do you think? I think the benefit is worth breaking the contracts. I've attached the burst of patches that lead to this.
PS Maybe I could create a SFImplementor simulator for legacy implementations, but that complicates things.
14 years, 7 months
Help to intoduce dynamic parameters into a message
by Johann Jmml
Hi,
I'm a newbie.
When validating a class, how to use values of dynamic parameters into a validation error message?
I explain, I want to take into account parameters which will be included into the text of the message referenced by EXCEPTION_ID id into a resource file. What is the best mean to do please?
1) @FilenameUnicity(message = "EXCEPTION_ID", (paramsToPutIntoTheMessage)???, groups = {
Default.class, Specific.class })
2) MessageInterpolator???
Thanks a lot.
14 years, 7 months
Plugguble component tuplizers
by Кирилл Кленский
Hi,
Pluggable component tuplizers are currently supported for component,
composite-element, composite-nested-element.
1. The definitions in
http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd are not
up-to-date. Should we use the DTD from jar in our mappings or should it
simply be fixed in the public version of DTD? There has been a similar issue
in the past: HHH-2559.
2. Another issue is that you can not specify a custom tuplizer for the
composite-id. However as far as I understood the Hibernate code supports
custom tuplizer creation for any component. This is similar to
issue HHH-3275.
Best regards,
Kirill Klenski
14 years, 7 months
Optimizing reflection optimization
by Кирилл Кленский
Hi,
Recently my task involved enabling hibernate reflection optimization in our
application.
Versions used:
hibernate-core-3.3.1.GA
javassist-3.4.GA
Below are some thoughts that hopefully could help to improve the product.
1. I have noticed that
org.hibernate.bytecode.javassist.BulkAccessorFactory.findAccessors(...) is
searching for accessor methods in the optimized entity class only. This
means that the methods from the superclasses are not visible during
BulkAccessor creation unless overridden by child classes. By enhancing the
algorithm to search down the inheritance tree we could avoid creation of
redundant methods which increase the code verbosity a lot. In our case
almost all the entities are inherited from the base classes having the
common entity properties defined, so the reflection optimization does not
work for any of them until we override the inherited methods in all the
child classes. The implementation is trivial, but I have got a ready
prototype if anybody is interested.
2. It seems that it should be also possible to optimize the EntityTuplizer's
getPropertyValue and setPropertyValue calls in the similar way how the
getPropertyValues and setPropertyValues are currently optimized.
Best regards,
Kirill Klenski
14 years, 7 months
Gradle branch
by Steve Ebersole
Wanted to point out that I have a new Gradle PoC branch in SVN at
https://svn.jboss.org/repos/hibernate/core/branches/gradle2 Of special
interest, this branch supports generating intellij project from the
source. The Gradle guys have been really awesome in helping me to get
this ready. You'll need at least the 0.9-preview2 release and you'd
simply run 'gradle idea' to generate the intellij project.
If anyone is really averse to installing gradle on their machines we
could try generating a wrapper too:
http://mrhaki.blogspot.com/2010/05/gradle-goodness-use-gradlew-for-easy.html
Its still a work in progress, but I think it shows the promise of using
gradle. Really the only parts missing at this point are:
1) integrating the testing (testsuite, jdbc3 and jdbc4 testing) stuff
which I have been waiting to do a "better way" leveraging Gradle
strengths (because it allows more than one artifact per project)
2) doing docbook builds
3) special handling for building a release
--
Steve Ebersole <steve(a)hibernate.org>
http://hibernate.org
14 years, 7 months
[HSEARCH] New Query API: last call
by Emmanuel Bernard
Guys,
I'me now done with the level of abstraction and fluidity I wanted out of the query DSL. Please review before we push that out. Key features:
- fluent API
- use the field bridge system: type is passed, not raw string
- use the analyzer transparently
- simple use case simple, complex use cases possible
I'm showing below a few examples demonstrating key concepts.
Please comment / ask questions.
Term query
query = monthQb
.keyword()
.onField( "monthValue" )
.matching( 2 ) //note that monthValue is of type int
.createQuery();
//term query, showing analyzer integration
query = monthQb
.keyword()
.onField( "mythology_ngram" )
.matching( "snobored" ) //we apply the ngram filter here
.createQuery();
//use fuzzy query
query = monthQb
.keyword()
.fuzzy()
.threshold( .8f ) //optional
.prefixLength( 1 ) //optional
.onField( "mythology" )
.matching( "calder" )
.createQuery();
//use wildcard queries
monthQb
.keyword()
.wildcard()
.onField( "mythology" )
.matching( "mon*" )
.createQuery();
Alternative option
//apply on multiple fields
monthQb.keyword()
.onField( "mythology" )
.boostedTo( 30 )
.andField( "history" )
.matching( "whitening" )
.createQuery();
//boost a field
monthQb
.keyword()
.onField( "history" )
.boostedTo( 30 )
.matching( "whitening" )
.createQuery();
Range query
//Range query
monthQb
.range()
.onField( "estimatedCreation" )
.from( from ) #from and to are actual java.util.Date. We do the conversion
.to( to ).exclude()
.createQuery();
monthQb
.range()
.onField( "estimatedCreation" )
.below( brithDay )
.createQuery();
Phrase query
monthQb
.phrase()
.slop( 1 )
.onField( "mythology" )
.sentence( "Month whitening" )
.createQuery();
Boolean query
monthQb
.bool()
.should( monthQb.keyword().onField( "mythology" ).matching( "whitening" ).createQuery() )
.should( monthQb.keyword().onField( "history" ).matching( "whitening" ).createQuery() )
.createQuery();
//Boolean query all except (recommended)
monthQb
.all()
.except( monthQb.keyword().onField( "mythology" ).matching( "colder" ).createQuery() )
.createQuery();
14 years, 7 months
do we still maintain the testes in testsuite/src/test/perf/ ?
by Strong Liu
I remember someone told me that those testes were not maintained anymore, if so, we should move them into "testsuite/src/test/unmaintained" to avoid confusion.
Hibernate performance vs JDBC - I run hibernate own test
-------------------------
Best Regards,
Strong Liu <stliu at redhat.com>
14 years, 7 months