[EJB 3.0] - need help with query
by aozoren
i have the following ejbql that returns the wrong outer join; it does not return all records from product:
select distinct p, opl.privilege from Product p left outer join p.organizationPrivilegeList opl where p.name like 'ms%' and opl.organization.id = 1
correct behaving regular sql is as follows:
select * from vb_product p left outer join (select * from vb_product_privilege where organization_id = 1) as pp on p.id = pp.product_id where p.name like 'ms%'
difference being organization filter is applied before the outer join.
can anyone help me write the same meaning in ejbql? or is it possible to use subqueries with where clauses in joins? any sample?
thanks.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4214325#4214325
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4214325
15 years, 10 months
[JBoss jBPM] - spring modules 0.9 with jbpm 3.2.2 error
by bestage
Hi all,
I am getting this nasty error. Is it some kind of dependency problem?
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'sessionFactory' defined in class path resource
[jbpm-spring.xml]: Invocation of init method failed; nested exception is
java.lang.NoClassDefFoundError: javax.jcr.RepositoryException
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean
(AbstractAutowireCapableBeanFactory.java:1337)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean
(AbstractAutowire
CapableBeanFactory.java:473)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged
(AccessController.java:219)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean
(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton
(DefaultSingletonBeanRegistry.java:221)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean
(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons
(DefaultListableBeanFactory.java:423)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization
(AbstractApplicationContext.java:729)
at
org.springframework.context.support.AbstractApplicationContext.refresh
(AbstractApplicationContext.java:381)
at
org.springframework.context.support.ClassPathXmlApplicationContext.
(ClassPathXmlApplicationContext.java:139)
at
org.springframework.context.support.ClassPathXmlApplicationContext.
(ClassPathXmlApplicationContext.java:93)
at
de.hsbc.trinkaus.ba.ssi.services.impl.ProcessServiceImplTest.oneTimeStepUp
(ProcessServiceImplTest.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.junit.internal.runners.ClassRoadie.runBefores
(ClassRoadie.java:49)
at org.junit.internal.runners.ClassRoadie.runProtected
(ClassRoadie.java:36)
at org.junit.internal.runners.JUnit4ClassRunner.run
(JUnit4ClassRunner.java:42)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run
(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
(RemoteTestRunner.java:196)
Caused by: java.lang.NoClassDefFoundError: javax.jcr.RepositoryException
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:68)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:129)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstructorAccessorImpl.java:67)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:522)
at org.hibernate.engine.UnsavedValueFactory.instantiate
(UnsavedValueFactory.java:22)
at org.hibernate.engine.UnsavedValueFactory.getUnsavedIdentifierValue
(UnsavedValueFactory.java:44)
at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty
(PropertyFactory.java:44)
at org.hibernate.tuple.entity.EntityMetamodel.
(EntityMetamodel.java:123)
at org.hibernate.persister.entity.AbstractEntityPersister.
(AbstractEntityPersister.java:434)
at org.hibernate.persister.entity.SingleTableEntityPersister.
(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister
(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.
(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory
(Configuration.java:1294)
at
org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory
(LocalSessionFactoryBean.java:814)
at
org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory
(LocalSessionFactoryBean.java:732)
at
org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet
(AbstractSessionFactoryBean.java:211)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods
(AbstractAutowireCapableBeanFactory.java:1368)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean
(AbstractAutowireCapableBeanFactory.java:1334)
... 28 more
Caused by: java.lang.ClassNotFoundException: javax.jcr.RepositoryException
at java.net.URLClassLoader.findClass(URLClassLoader.java:496)
at java.lang.ClassLoader.loadClass(ClassLoader.java:631)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:597)
... 49 more
|
|
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
| "http://www.springframework.org/dtd/spring-beans.dtd">
|
| <beans>
|
| <!-- SessionFactory definition -->
|
| <bean id="dataSource"
| class=
| "org.springframework.jdbc.datasource.DriverManagerDataSource">
| <property name="driverClassName">
| <value>com.ibm.db2.jcc.DB2Driver</value>
| </property>
| <property name="url">
| <value>jdbc:db2:/xxxxxx</value>
| </property>
|
| <property name="username">
| <value>xxx</value>
| </property>
|
| <property name="password">
| <value>xxx</value>
| </property>
|
| </bean>
|
|
| <bean id="sessionFactory"
| class=
| "org.springframework.orm.hibernate3.LocalSessionFactoryBean">
| <property name="dataSource" ref="dataSource" />
| <property name="mappingLocations"
| value="classpath*:/org/jbpm/**/*.hbm.xml">
| </property>
| <property name="schemaUpdate" value="true" />
|
| <property name="configLocation">
| <value>classpath:/hibernate.cfg.xml</value>
| </property>
|
| </bean>
|
|
| <!-- JBPM Configuration -->
| <bean id="jbpmConfiguration"
| class=
| "org.springmodules.workflow.jbpm31.LocalJbpmConfigurationFactoryBean">
| <property name="sessionFactory" ref="sessionFactory" />
| <property name="configuration" value="classpath:/jbpm.cfg.xml"
| />
| </bean>
|
| <!-- jBPM template -->
| <bean id="jbpmTemplate"
| class="org.springmodules.workflow.jbpm31.JbpmTemplate">
| <constructor-arg index="0" ref="jbpmConfiguration" />
| <constructor-arg index="1" ref="my-workflow" />
| </bean>
|
| </beans>
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4214324#4214324
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4214324
15 years, 10 months