[EJB 3.0] - Question about sequences and entity ejbs 3.0
by balteo
Hello,
I have simplified my problem as follows: I have a three-field table as follows:
| pk key name
| 1 1 johm (this is an insert)
| 2 1 john (this is an update)
| 3 2 Pat (this is an insert)
|
The requirement for one table cannot be changed.
I have a auto generated identity or a sequence for pk.
My question relates to key. As you have noticed key is not unique.
How can I retrieve the value used for the pk for use by key field when I do an insert bearing in mind I currently use an auto generated identity (with DB2). Do I need a sequence? Please advise me on the best strategy.
Please tell me what code I need on the entity bean side (the one that is persisted) and on the session bean side (the one that persists the entity).
Please help!!!
Thanks in advance,
Julien Martin.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033672#4033672
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033672
18 years, 7 months
[EJB 3.0] - Re: Corba
by ollka
As i understand, my exception is a result of "double" binding to the same name. I don't know, why it happens, but it occurs only when i redeploy my ejbs.
If i restart whole server, i have another exception:
java.lang.ClassCastException
at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
at org.jboss.ejb3.iiop.IORFactory.createProxy(IORFactory.java:154)
... 136 more
Caused by: java.lang.ClassCastException: Object is not of remote type javax.ejb.EJBObject
at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:221)
... 138 more
If i use EJBObject - i have ejb2, isn't so?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033663#4033663
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033663
18 years, 7 months
[JBoss Seam] - Re: Exporting XML with faceltes
by pbrewer_uk
This is really just a jsf question, but you can acheive this just like exporting to html - with one key difference, you must include the f:view tag with a content type of text/xml. Although I have used facelet templates with this technique, I assume the examples below can easily be adapted.
Note 1: You can specify content types other than text/xml - if you do, make sure the f:view encloses your output document - facelets will only parse valid xml.
Note 2: This will not work with icefaces - its direct to dom rendered expects a dom tree with root element of html (haven't checked this with 1.6 releases though).
Note 3: Seam now provides a way of outputting pdf documents using jsf tags - see seam docs!
Example 1: outputting xml
| <?xml version="1.0" encoding="utf-8" ?>
| <myXmlRoot xmlns:t="http://myfaces.apache.org/tomahawk"
| xmlns:f="http://java.sun.com/jsf/core">
| <f:view contentType="text/xml" />
| <t:dataList var="rowData" value="#{results}">
| <myItem>#{rowData.description}</myItem>
| </t:dataList>
| </myXmlRoot>
|
Example 2: outputting csv
| <f:view contentType="text/csv"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:t="http://myfaces.apache.org/tomahawk">
|
| "First Item", "Second Item"
| <t:dataList var="rowData" value="#{results}">
| "#{rowData.item1}", "#{rowData.item2}"
| </t:dataList>
|
| </f:view>
|
Hope this helps,
Pete
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033662#4033662
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033662
18 years, 7 months