i have used the following things in toplink for calling derby stored procedure , it works fine
@SqlResultSetMapping(name = "LedgerGroupMapping",
entities = {@EntityResult(entityClass = LedgerGroup.class)})
@NamedNativeQueries( {
@NamedNativeQuery(name = "LedgerGroup.getLedgerGroupsBasedonParentLedgerGroupTODepthN", query = "call app.getLedgerGroupsBasedonParentLedgerGroupTODepthN(?)", resultSetMapping = "LedgerGroupMapping")})
now i am trying this in hibernate it cause following exception
javax.persistence.PersistenceException: [PersistenceUnit: AddressPU] Unable to configure EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:265)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
at com.cyberbeoz.databasehandler.DatabaseHandler.openDatabase(DatabaseHandler.java:797)
... 5 more
Caused by: org.hibernate.cfg.NotYetImplementedException: Pure native scalar queries are not yet supported
at org.hibernate.cfg.annotations.QueryBinder.bindNativeQuery(QueryBinder.java:118)
at org.hibernate.cfg.annotations.QueryBinder.bindNativeQueries(QueryBinder.java:197)
at org.hibernate.cfg.AnnotationBinder.bindQueries(AnnotationBinder.java:307)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:437)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:534)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:286)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1121)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1225)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:159)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:854)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:191)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:253)
... 8 more
how to run the procedure call in named nativequery in hibernate ?
ashok
[/b]
|