[JBoss-user] [EJB 3.0] - NPE doing queries

2006-05-06 Thread mick_mcgovern
I've been working ok with things for a few weeks but now I'm getting NPE under 
some strange conditions.

For example,

an entity manager find method would work but a query using the id as the 
parameter would fail with the NPE on the query.getSingleResult().

I also found that changing the order of calls to some of the DAO methods would 
break, others would work - exactly the same code, called in different order.

E.g. the following fails with an NPE in the second method.

Teller teller = tellerDAO.findTellerByTellerNum(tellerNum, 
true, em);
List trans = tranDAO.findAllTrans(em);  
List tellers = tellerDAO.findAllTellers(em);


Swap method call order around and it works...

List trans = tranDAO.findAllTrans(em);  
List tellers = tellerDAO.findAllTellers(em);
Teller teller = tellerDAO.findTellerByTellerNum(tellerNum, 
true, em);

So findAllTrans works as long as its first. BTW the NPE comes out of the 
query.getResultList() method. The Tran class is very basic table with 5 
columns, simple Id and version - very little to go wrong and up until recently 
has been working fine.

I've obviously (?) broken something but that hardly explains this sort of 
behaviour.

Any ideas?

Thanks

Michael



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3941708#3941708

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3941708


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: CollectionOfElements - various issues

2006-05-02 Thread mick_mcgovern
The NPE was my own issue but the override of table and column names remains an 
issue for me.

Anyone got any examples of this the @CollectionOfElement mapping?

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3940856#3940856

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3940856


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - CollectionOfElements - various issues

2006-04-30 Thread mick_mcgovern
I've had a few problems with an owned list.

Firstly I can't override the table name, the JoinTable annotation is not 
compatible with the documentation (name attribute instead of table?)

The generated code was coming up with column names like 'teller_teller_num' 
where teller_num is the PK on the main table and part of in the owned table.

In both cases I fudged the DDL to match the generated code and it reads it OK 
but gives a NPE from the bowels of the JBoss/EJB3 code on em.flush();.

If I remove the code that simply iterates this list there is no problem.

I'm using 404 CR2 and RC6 PFD.

Can someone please give examples of such mappings?






View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3940416#3940416

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3940416


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user