Re: [appfuse-user] How to override the User object with my own version so I can add new relationships in Appfuse 2.0M5

2007-08-24 Thread Matt Raible
This may help: http://appfuse.org/display/APF/AppFuse+Core+Classes Matt On 8/24/07, Scott Ryan <[EMAIL PROTECTED]> wrote: > I have been looking at the appfuse posts and trying to find a best practice > for this but cannot locate the answer. I am using Appfuse 2.0M5 and wanting > to override the

Re: [appfuse-user] How database exceptions are handled in appfuse-jsf?

2007-08-24 Thread Matt Raible
Why are you throwing a generic exception like java.sql.SQLException? Spring's DataAccessException (and many others) are designed to be wrappers around this exception to give you much better information. As far as exception handling goes - that's up to you to catch. Most web frameworks have a way t

Re: [appfuse-user] AW: Add new function after login

2007-08-24 Thread Matt Raible
You might try registering Spring's RequestContextListener in your web.xml. That way, you can get the request from a ThreadLocal and get the session from that. http://www.springframework.org/docs/api/org/springframework/web/context/request/RequestContextListener.html Matt On 8/24/07, BruceLee <[E

Re: [appfuse-user] Issue with filter on join table

2007-08-24 Thread Dale Newfield
Don't forget that you have the entire power of HQL at your disposal. If you want to add a "where" clause, go ahead. It's arbitrary "on" clauses that hibernate cannot yet do. (Although it does create sql joins with complex on clauses--those inherent in the object relationships.) A filter won'

[appfuse-user] How database exceptions are handled in appfuse-jsf?

2007-08-24 Thread sudheerp
Hi, I am using appfuse-jsf 1.9.4 Do I have to throw DataAccessException and java.sql.SQLException in the following HibernateSpringDAOImpl? How are database exceptions like DB unavailable, bad query etc are handled in appfuse-jsf? public boolean FoundEmptyToDate( Long parentId ) th

Re: [appfuse-user] AW: Add new function after login

2007-08-24 Thread BruceLee
Thank Absolut a lot for sharing the helpful code. However when I try to getSession() in the Listener, sometimes it returns null. After I refresh the page serveral times, it gets normal. Any ideas? ---my code--- public void onApplicationEvent(ApplicationEvent event) { // check failed eve

[appfuse-user] How to override the User object with my own version so I can add new relationships in Appfuse 2.0M5

2007-08-24 Thread Scott Ryan
I have been looking at the appfuse posts and trying to find a best practice for this but cannot locate the answer. I am using Appfuse 2.0M5 and wanting to override the User object so I can add more relationships. I am using the JPA version and not sure how to approach this one. I have t

Re: [appfuse-user] Issue with filter on join table

2007-08-24 Thread Eric Fitzsimmons
Thank you for the reply. The joins all work fine in the tests and I can filter out the information after it is pulled from the database, but I am just getting huge records and would rather have the filter take care of the extra information in the sql statement as apposed to in memory. Thanks

Re: [appfuse-user] what is the alternate to "mvn appfuse:full-source" for struts 2 modular project

2007-08-24 Thread jaywalkable
Hello Mike, I forgot to run "mvn install". I found that all the tests are running fine. Then I moved on to appfuse:gen in the web module. Thanks Rubel Ahammad Mike Horwitz wrote: > > Haeve you run a mvn install on you core component? It seems it can find > the > class you generated in core. >

Re: [appfuse-user] Issue with filter on join table

2007-08-24 Thread Dale Newfield
Eric Fitzsimmons wrote: Using AF 2 m5 Struts full source. I am trying to add a filter to a join table that will filter for an active date range. I've not worked with JPA or with filters, so I can't offer much specific help, but I can point out that I don't think you're doing what you think y

[appfuse-user] Issue with filter on join table

2007-08-24 Thread Eric Fitzsimmons
Using AF 2 m5 Struts full source. I am trying to add a filter to a join table that will filter for an active date range. I added for the class @FilterDef(name="effectiveDateInfo) I added for the attribute which has a @OneToOne mapping @FilterJoinTable(name="effectiveDateInfo", condition="'2006-1

Re: [appfuse-user] Hibernate cascade delete not working

2007-08-24 Thread kla
Figured it out... It had to do with me setting the inverse='true' on the Document side of the relationship. By moving inverse='true' to the 'documents' Set under class 'Project', it allowed the Document instance to manage the relationship. Great explanation of it here: http://simoes.org/docs/hi

Re: [appfuse-user] [Spring mvc] problem with form:select multiple

2007-08-24 Thread Michael Horwitz
Could you post your modified annotations? On 8/24/07, Julien C. <[EMAIL PROTECTED]> wrote: > > It's not better. > > > Michael Horwitz a écrit : > > Try this from the Hibernate annotiations guide: > > To map a bidirectional one to many, with the one-to-many side as the > owning side, you have to re

Re: [appfuse-user] Avoid Struts 2 OgnlUtil warning on redirection-action

2007-08-24 Thread Matt Raible
I agree - if you submit this as a ticket in JIRA - I'll commit it this morning. http://issues.appfuse.org/browse/APF Matt On 8/24/07, benoit moraillon <[EMAIL PROTECTED]> wrote: > I think log4j.xml should include this for appfuse 2 / struts 2 archetype : > > > > > > In order to av

Re: [appfuse-user] [Spring mvc] problem with form:select multiple

2007-08-24 Thread Julien C.
It's not better. Michael Horwitz a écrit : Try this from the Hibernate annotiations guide: To map a bidirectional one to many, with the one-to-many side as the owning side, you have to remove the mappedBy element and set the many to one @JoinColumn as insertable and updatable to false. This

Re: [appfuse-user] hibernate InheritanceType.TABLE_PER_CLASS issue

2007-08-24 Thread Matt Raible
The only thing that stands out is the following line: locationDao.get(1L); Does reducing this number, or changing it to -10L change the behavior? Matt On 8/23/07, p7k <[EMAIL PROTECTED]> wrote: > > Dear Matt and users, > > When you have time, if you have time, take a look at this code > htt

Re: [appfuse-user] RE: RE: menu-config.xml show/hide menu item with roles

2007-08-24 Thread Matt Raible
select * from user_role. Matt On 8/24/07, ros <[EMAIL PROTECTED]> wrote: > > How I can see user roles? > > > benoit wrote: > > > > I think you should check your user's role in order to know what role > > is assigned to the anonymous user. > > > > -Message d'origine- > > De : ros [mailto:[

Re: [appfuse-user] [Spring mvc] problem with form:select multiple

2007-08-24 Thread Michael Horwitz
Try this from the Hibernate annotiations guide: To map a bidirectional one to many, with the one-to-many side as the owning side, you have to remove the mappedBy element and set the many to one @JoinColumn as insertable and updatable to false. This solution is obviously not optimized and will prod

Re: [appfuse-user] [Spring mvc] problem with form:select multiple

2007-08-24 Thread Julien C.
I think it's correct : - @Entity public class Enquete implements java.io.Serializable { ... @OneToMany(mappedBy="enquete",cascade=CascadeType.ALL) public Set getModeles() { return modeles; } ... } @Entity public class Modele implement

Re: [appfuse-user] [Spring mvc] problem with form:select multiple

2007-08-24 Thread Michael Horwitz
Have you set the appropriate cascade on the relationship between Enquete and Modele? Mike On 8/24/07, Julien C. <[EMAIL PROTECTED]> wrote: > Hi, > > I don't figure out how to use the form:select tag with multiple select. I > have try this : > > - > > > >

Re: [appfuse-user] turning off hbm2ddl and dbunit

2007-08-24 Thread Julien C.
Thanks Michael. I have to take a look to maven's doc. Julien. Michael Horwitz a écrit : At the moment both of these plugins are set to fire unless you specify -Dmaven.test.skip=true, which will have the unfortunate side effect of making maven skip your test as well. You could move the plugin

[appfuse-user] [Spring mvc] problem with form:select multiple

2007-08-24 Thread Julien C.
Hi, I don't figure out how to use the form:select tag with multiple select. I have try this : - itemLabel="nom"> - no errors but nothing is selected and nothing is saved - I have registered a custom binder for Mo

Re: [appfuse-user] Hibernate cascade delete not working

2007-08-24 Thread kla
Thanks for the suggestion. I did try this but it didn't work. But...then I looked closer at the log...What is actually happening is that Hibernate is trying to delete: document_project - which is okay. document - which is okay too... then the project! - NOT okay. Can anyone see, based upon my m

[appfuse-user] RE: RE: menu-config.xml show/hide menu item with roles

2007-08-24 Thread ros
How I can see user roles? benoit wrote: > > I think you should check your user's role in order to know what role > is assigned to the anonymous user. > > -Message d'origine- > De : ros [mailto:[EMAIL PROTECTED] > Envoyé : vendredi 24 août 2007 13:32 > À : users@appfuse.dev.java.net

[appfuse-user] Avoid Struts 2 OgnlUtil warning on redirection-action

2007-08-24 Thread benoit moraillon
I think log4j.xml should include this for appfuse 2 / struts 2 archetype : In order to avoid the famous OgnlUtil.setProperty warning when doing a redirect-action with parameter. See :https://issues.apache.org/struts/browse/WW-1714 -

RE: [appfuse-user] RE: menu-config.xml show/hide menu item with roles

2007-08-24 Thread benoit moraillon
I think you should check your user's role in order to know what role is assigned to the anonymous user. -Message d'origine- De : ros [mailto:[EMAIL PROTECTED] Envoyé : vendredi 24 août 2007 13:32 À : users@appfuse.dev.java.net Objet : [appfuse-user] RE: menu-config.xml show/hide menu ite

[appfuse-user] RE: menu-config.xml show/hide menu item with roles

2007-08-24 Thread ros
Why menu item always hidden? In in menu-config.xml there is Thanks. benoit wrote: > > ROLE_ANONYMOUS is the anonymous role name by default in acegi (no > authentication). > > -Message d'origine- > De : ros [mailto:[EMAIL PROTECTED] > Envoyé : vendredi 24 août 2007 13:08 > À : users

RE: [appfuse-user] menu-config.xml show/hide menu item with roles

2007-08-24 Thread benoit moraillon
ROLE_ANONYMOUS is the anonymous role name by default in acegi (no authentication). -Message d'origine- De : ros [mailto:[EMAIL PROTECTED] Envoyé : vendredi 24 août 2007 13:08 À : users@appfuse.dev.java.net Objet : [appfuse-user] menu-config.xml show/hide menu item with roles Hi! How i

[appfuse-user] menu-config.xml show/hide menu item with roles

2007-08-24 Thread ros
Hi! How in appfuse application to show menu item for anonymous user and admin, but hide this menu item for user with other roles (e.g. role editor). If in menu-confg.xml there is: then item visible for all users. If in menu-config there is: then it's not visible at all. Wha

Re: [appfuse-user] turning off hbm2ddl and dbunit

2007-08-24 Thread Michael Horwitz
At the moment both of these plugins are set to fire unless you specify - Dmaven.test.skip=true, which will have the unfortunate side effect of making maven skip your test as well. You could move the plugin definitions to their own profile, which you can selectively enable based on a property. Mike

Re: [appfuse-user] Hibernate running SQL statements directly in appfuse

2007-08-24 Thread Michael Horwitz
You can run native SQL queries using Hibernate. See http://www.hibernate.org/hib_docs/v3/reference/en/html/querysql.html for further details. Mike. On 8/24/07, Sanath <[EMAIL PROTECTED]> wrote: > > > I have a rather long and complex SQL query that has nested quires inside > too. > I have notices

[appfuse-user] turning off hbm2ddl and dbunit

2007-08-24 Thread Julien C.
Hi List, I want to turn off this 2 plugins when I test some class to be more productive. Is there a parameter in maven command line to disabled this. something like this : mvn test -Dtest=ModeleDaoTest -Ddbunit.disabled=true -Dhbm2ddl.disabled=true Thanks, Julien Chanséaume.

[appfuse-user] Hibernate running SQL statements directly in appfuse

2007-08-24 Thread Sanath
I have a rather long and complex SQL query that has nested quires inside too. I have notices that appfuse uses getHibernateTemplate().find to give the HQL statement. Is there anyway that I can run a "SQL" statement without using HQL statements to avoid much more complexity -- View this message in

Re: [appfuse-user] hibernate: Lazy Loading 101

2007-08-24 Thread Michael Horwitz
You will need to explicitly tell it to cascade on a merge by setting the cascade attribute on your join. Mike. On 8/24/07, p7k <[EMAIL PROTECTED]> wrote: > > > no success in using merge(), no exceptions of any sort but nothing gets > updated or removed. > > still looking for help. > > thank you!