This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Emmanuel Bernard <[email protected]> | |
*/ | |
public class SearchServiceV2 { | |
@Inject | |
FullTextEntityManager em; | |
private org.hibernate.search.FullTextQuery ftQuery; | |
/** | |
* do the initial query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void doStuff() { | |
String userQuery = "..."; | |
SearchService search = new SearchService(); | |
//do the query and display it using your favorite tech | |
List<Car> results = search.searchCar( userQuery ); | |
displayResultsOnScreen( results ); | |
//build the Facet menu and display it | |
search.displayFacets(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ hibernate-ogm-core --- | |
[INFO] org.hibernate.ogm:hibernate-ogm-core:jar:3.0.0-SNAPSHOT | |
[INFO] +- org.hibernate:hibernate-core:jar:3.6.3-SNAPSHOT:compile | |
[INFO] | +- antlr:antlr:jar:2.7.6:compile | |
[INFO] | +- commons-collections:commons-collections:jar:3.1:compile | |
[INFO] | +- dom4j:dom4j:jar:1.6.1:compile | |
[INFO] | +- org.hibernate:hibernate-commons-annotations:jar:3.2.0.Final:compile | |
[INFO] | +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final:compile | |
[INFO] | \- javax.transaction:jta:jar:1.1:compile | |
[INFO] +- org.hibernate:hibernate-entitymanager:jar:3.6.3-SNAPSHOT:compile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
cfg.configure( | |
adapter, | |
Collections.singletonMap( AvailableSettings.VALIDATION_FACTORY, token ) | |
); | |
+ cfg.buildEntityManagerFactory(); | |
fail( "Was expecting error as token did not implement ValidatorFactory" ); | |
} | |
catch ( HibernateException e ) { | |
// probably the condition we want but unfortunately the exception is not specific |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sessionFactory.openSession( | |
new SessionOptionBuilder() | |
.interceptor(interceptor) | |
.autoJoin(false) | |
.get() | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sessionFactory | |
.withSessionOptions() | |
.interceptor(interceptor) | |
.autoJoin(false) | |
.openSession(); | |
sessionFactory | |
.withSessionOptionsFrom(otherSession) | |
.interceptor(interceptor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AddressableObject<T extends Address> { | |
T getAddress(); | |
} | |
class IPContainer<IPAddress> { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
manu@dhcp-193-194 ogm (OGM-30 *) $ mvn dependency:tree | |
[INFO] Scanning for projects... | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Reactor Build Order: | |
[INFO] | |
[INFO] Hibernate OGM Aggregator | |
[INFO] Hibernate Object Grid Mapper | |
[INFO] | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Building Hibernate OGM Aggregator 3.0.0-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//old | |
public void flush() { | |
try { | |
if ( !isTransactionInProgress() ) { | |
throw new TransactionRequiredException( "no transaction is in progress" ); | |
} | |
getSession().flush(); | |
} | |
catch ( RuntimeException e ) { | |
throw convert( e ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Caused by: org.infinispan.config.ConfigurationException: Component factory class org.infinispan.factories.MarshallerFactory incorrectly registered! Debug stack: null | |
[java] at org.infinispan.factories.AbstractComponentRegistry.getFactory(AbstractComponentRegistry.java:365) | |
[java] at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:317) | |
[java] at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:254) | |
[java] at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:843) | |
[java] at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:228) | |
[java] at org.infinispan.factories.ComponentRegistry.registerComponent(ComponentRegistry.java:133) | |
[java] at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:185) | |
[java] at |