[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1962) add default value expressions to EntityTransaction and HibernateTransaction
by Dan Allen (JIRA)
add default value expressions to EntityTransaction and HibernateTransaction
---------------------------------------------------------------------------
Key: JBSEAM-1962
URL: http://jira.jboss.com/jira/browse/JBSEAM-1962
Project: JBoss Seam
Issue Type: Feature Request
Components: Core
Affects Versions: 2.0.0.CR1
Reporter: Dan Allen
Priority: Minor
Fix For: 2.0.1.GA
The Seam CRUD framework uses the standard names entityManager for JPA and session for Hibernate when the name of the persistence context is not specified. However, EntityTransaction and HibernateTransaction components do not use default values. It seems like it would be beneficial to add default values to save a couple of keystrokes. I agree it is pretty minor, but as the Seam documentation says, and I quote "All those keystrokes add up!"
Assuming I have a managed persistence context named "entityManager"
Current:
<transaction:entity-transaction entity-manager="#{entityManager}" />
Desired:
<transaction:entity-transaction />
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 4 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2008) Query should use parameterized type for results
by Dan Allen (JIRA)
Query should use parameterized type for results
-----------------------------------------------
Key: JBSEAM-2008
URL: http://jira.jboss.com/jira/browse/JBSEAM-2008
Project: JBoss Seam
Issue Type: Feature Request
Components: Tools
Affects Versions: 2.0.0.CR1
Reporter: Dan Allen
Priority: Minor
Fix For: 2.0.0.GA
I don't see any reason why Query cannot be defined as Query<T, E> rather than Query<T>. The general design of Query is that it operates on a static base query (only the conditions are dynamic). Therefore, the item type in the result list should be anticipated. In any case, if it is not, you can always define it using the generic type Object.
To cite an example, we start with:
public class EntityQuery<E> extends Query<EntityManager, E> {}
We can use it as:
public class CategoryQuery extends EntityQuery<Category> {
}
CategoryQuery q = new CategoryQuery();
for ( Category c : q.getResultList() ) {
// didn't need to cast!
}
On the other hand, if the query component is defined without the type, it will still work. The type will be treated as java.lang.Object.
public class CategoryQuery extends EntityQuery {
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 4 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1842) Need javadoc for Home and EntityHome classes
by steve tynor (JIRA)
Need javadoc for Home and EntityHome classes
--------------------------------------------
Key: JBSEAM-1842
URL: http://jira.jboss.com/jira/browse/JBSEAM-1842
Project: JBoss Seam
Issue Type: Feature Request
Components: Documentation
Affects Versions: 2.0.0.BETA1
Reporter: steve tynor
Seamgen generates classes derived from EntityHome which often must be customized by the end user developer. Currently there is no documentation, not even javadocs, for the various functions inherited from Home and EntityHome (what is the "contract" for the wire()/isWired() functions? If a new instance needs to be initialized with default values, where should that be done (createInstance()? wire()? somewhere else?). How is getDefinedInstance() intended to be used? Under what circumstances should setId() be called?
Seamgen is all well and good for getting a sort-of-working CRUD application up and running, but the generated files invariably need to be edited / adapted / customized and without documentation for how they are intended to be used, each end user developer must guess at what the seamgen framework intends.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 4 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1756) Calling resultList.size() on framework entity-query with max-results= set gives error
by David Spark (JIRA)
Calling resultList.size() on framework entity-query with max-results= set gives error
-------------------------------------------------------------------------------------
Key: JBSEAM-1756
URL: http://jira.jboss.com/jira/browse/JBSEAM-1756
Project: JBoss Seam
Issue Type: Bug
Components: EL
Affects Versions: 2.0.0.BETA1
Environment: JBoss-4.2.1.GA
Reporter: David Spark
I'm trying to get the number of results from the following query (in components.xml):
Code: <framework:entity-query
name="clients"
ejbql="SELECT c FROM Client c"
max-results="20"/>
And this is in my page:
Code: <h:outputText value="#{clients.resultList.size()} clients available"/>
But when I try to load the page I get the following error (I also use the query to create a dataTable and that works fine):
javax.faces.FacesException: javax.el.ELException: /clientSelect.xhtml @14,77 value="#{clients.resultList.size()} clients available": java.lang.IllegalAccessException: Class org.jboss.el.util.ReflectionUtil can not access a member o
f class java.util.SubList with modifiers "public"
at javax.faces.component.UIOutput.getValue(UIOutput.java:176)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:1
89)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:320)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:200)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:286)
at org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:189)
at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:184)
at org.ajax4jsf.framework.renderer.RendererBase.encodeChildren(RendererBase.java:121)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:577)
at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:232)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290
)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:63)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:87)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:46)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:126)
Caused by: javax.el.ELException: /clientSelect.xhtml @14,77 value="#{clients.resultList.size()} clients available": java.lang.IllegalAccessException: Class org.jboss.el.util.ReflectionUtil can not access a member o
f class java.util.SubList with modifiers "public"
at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
at javax.faces.component.UIOutput.getValue(UIOutput.java:173)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:1
89)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:320)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:200)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:286)
at org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:189)
at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:184)
at org.ajax4jsf.framework.renderer.RendererBase.encodeChildren(RendererBase.java:121)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:577)
at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:232)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290
)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:63)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:87)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:46)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
Caused by: java.lang.IllegalAccessException: Class org.jboss.el.util.ReflectionUtil can not access a
member of class java.util.SubList with modifiers "public"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
at java.lang.reflect.Method.invoke(Method.java:578)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:325)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:270)
at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
at org.jboss.el.parser.AstDeferredExpression.getValue(AstDeferredExpression.java:26)
at org.jboss.el.parser.AstCompositeExpression.getValue(AstCompositeExpression.java:31)
at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
at javax.faces.component.UIOutput.getValue(UIOutput.java:173)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:1
89)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:320)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:200)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:286)
at org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:189)
at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:184)
at org.ajax4jsf.framework.renderer.RendererBase.encodeChildren(RendererBase.java:121)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:577)
at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:232)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290
)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
Here is the patch to reproduce
Code:
### Eclipse Workspace Patch 1.0
#P jboss-seam
Index: examples/ui/resources/WEB-INF/components.xml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/ui/resources/WEB-INF/components.xml,v
retrieving revision 1.9
diff -u -r1.9 components.xml
--- examples/ui/resources/WEB-INF/components.xml 1 Aug 2007 11:49:57 -0000 1.9
+++ examples/ui/resources/WEB-INF/components.xml 3 Aug 2007 12:11:52 -0000
@@ -21,7 +21,7 @@
<framework:entity-home name="personHome" entity-class="org.jboss.seam.example.ui.Person" />
- <framework:entity-query name="colours" ejbql="select c from Colour c" />
+ <framework:entity-query name="colours" ejbql="select c from Colour c" max-results="2" />
<framework:entity-query name="books" ejbql="select b from Book b" />
Index: examples/ui/view/index.xhtml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/ui/view/index.xhtml,v
retrieving revision 1.4
diff -u -r1.4 index.xhtml
--- examples/ui/view/index.xhtml 13 Jun 2007 23:49:05 -0000 1.4
+++ examples/ui/view/index.xhtml 3 Aug 2007 12:11:52 -0000
@@ -10,5 +10,6 @@
<ui:param name="tagName" value="" />
<ui:define name="body">
<p>Seam ui components</p>
+ <h:outputText value="#{colours.resultList.size()}" />
</ui:define>
</ui:composition>
\ No newline at end of file
And visit the index.xhtml page on the ui example
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 4 months