Pessoal, recebo a seguinte mensagem de erro ao tenytar utilizar uma query num hbm.xml:
Named query not known: pontosControleByLinCod; nested exception is org.hibernate.MappingException: Named query not known: pontosControleByLinCod
chamo a query da seguinte maneira:
public class TVitLinhaControleDAOHibernate extends BaseDAOHibernateImpl implements BaseDAOHibernate {
public List findPontosControleByLinCod (Long parameter) throws Exception {
return findByNamedQuery("pontosControleByLinCod", parameter);
}
}
a query está no arquivo TVitLinhaControle.hbm.xml:
<query name="pontosControleByLinCod">
select tp
from TVitPontoControle tp, TVitLinhaControle lc
where tp.isPontoControle = lc.isPontoControle
and lc.linCod = ?
</query>
e essa arquivo eu mapeio no spring-config.xml
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource" />
</property>
<property name="mappingResources">
<list>
<value>br/com/checkrota/srv/model/vitoria/TVitLinhaControle.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
<prop key="hibernate.default_schema">findnet</prop>
<!-- <prop key="hibernate.query.substitutions">true 1, false 0</prop> -->
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">true</prop>
<prop key="hibernate.c3p0.min_size">1</prop>
<prop key="hibernate.c3p0.max_size">100</prop>
<prop key="hibernate.c3p0.timeout">600</prop>
<prop key="hibernate.c3p0.max_statements">50</prop>
<prop key="hibernate.c3p0.idle_test_period">60</prop>
</props>
</property>
</bean>
enfim, alguém pode dar uma luz no que tenho q resolver pra query ser executada???