use of org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewHQLCodeAssist.
@Test
public void testNewHQLCodeAssist() {
IConfiguration configuration = service.newDefaultConfiguration();
configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
IHQLCodeAssist hqlCodeAssist = service.newHQLCodeAssist(configuration);
Assert.assertNotNull(hqlCodeAssist);
}
use of org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist in project jbosstools-hibernate by jbosstools.
the class ConsoleExtension method hqlCodeComplete.
public CompletionProposalsResult hqlCodeComplete(String query, int startPosition, int currentOffset) {
HQLCompletionHandler handler = new HQLCompletionHandler(startPosition);
if (!hibernateExtension.hasConfiguration()) {
try {
hibernateExtension.build();
hibernateExtension.buildMappings();
} catch (HibernateException e) {
// FIXME
// String mess =
// NLS.bind(HibernateConsoleMessages.CompletionHelper_error_could_not_build_cc,
// consoleConfiguration.getName());
// HibernateConsolePlugin.getDefault().logErrorMessage(mess, e);
}
}
IHQLCodeAssist hqlEval = hibernateExtension.getHibernateService().newHQLCodeAssist(hibernateExtension.getConfiguration());
query = query.replace('\t', ' ');
hqlEval.codeComplete(query, currentOffset, handler);
return new CompletionProposalsResult(handler.getCompletionProposals(), handler.getLastErrorMessage());
}
use of org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateHQLCodeAssist.
@Test
public void testCreateHQLCodeAssist() {
HQLCodeAssist hqlCodeAssist = new HQLCodeAssist(null);
IHQLCodeAssist facade = facadeFactory.createHQLCodeAssist(hqlCodeAssist);
Assert.assertSame(hqlCodeAssist, ((IFacade) facade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateHQLCodeAssist.
@Test
public void testCreateHQLCodeAssist() {
HQLCodeAssist hqlCodeAssist = new HQLCodeAssist(new Configuration());
IHQLCodeAssist facade = facadeFactory.createHQLCodeAssist(hqlCodeAssist);
Assert.assertSame(hqlCodeAssist, ((IFacade) facade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IHQLCodeAssist in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewHQLCodeAssist.
@Test
public void testNewHQLCodeAssist() {
IConfiguration configuration = service.newDefaultConfiguration();
configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
IHQLCodeAssist hqlCodeAssist = service.newHQLCodeAssist(configuration);
Assert.assertNotNull(hqlCodeAssist);
}
Aggregations