Re: Early steps getting Tapestry and Hibernate working via DAO
Wow, Tapestry Hibernate is much easier than my customize hibernate code... fascinating ^_^. http://code.google.com/p/tapestry5examples/downloads/detail?name=folderTap5_15.jarcan=2q=sort=filename http://code.google.com/p/tapestry5examples/downloads/detail?name=folderTap5_15.jarcan=2q=sort=filename Keep it up... -- View this message in context: http://tapestry.1045711.n5.nabble.com/Early-steps-getting-Tapestry-and-Hibernate-working-via-DAO-tp3072498p3218483.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
Best Example http://lombok.demon.co.uk/folderTap5/ Good Luck... -- View this message in context: http://tapestry.1045711.n5.nabble.com/Early-steps-getting-Tapestry-and-Hibernate-working-via-DAO-tp3072498p3211319.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
Thanks i will try to use tapestry-hibernate integration see what will be the difference of these ^_^... -- View this message in context: http://tapestry.1045711.n5.nabble.com/Early-steps-getting-Tapestry-and-Hibernate-working-via-DAO-tp3072498p3206907.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
So what would be the difference? The important is you achieve what you want to do. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Early-steps-getting-Tapestry-and-Hibernate-working-via-DAO-tp3072498p3204134.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
Which is true, but if you aren't going to use the facilites of Tapestry, such as its built-in Hibernate integration, then please seek answers to your problems elsewhere. Using the Tapestry mechanisms means that the you can be sure of using the same session instance across all pages, components and services (within a transaction). The session will be created only as needed and will be discarded automatically at the end of the request. You can use @CommitAfter on any component method, and can configure you services to recognize it as well. In addtion, you have added in-Tapestry hooks to configure Hibernate at startup, and Tapestry will automatically register entity beans it finds in your applications' entities package, and automatically set up URL encoding/decoding of entity objects. It's actually quite a lot. So there's reasons to use the right tools. But again, if you want to use some other approach, that's fine ... just don't seek help here. Go on the Hibernate mailing lists. On Fri, Oct 8, 2010 at 12:07 AM, ael alan-lua...@dash.com.ph wrote: So what would be the difference? The important is you achieve what you want to do. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Early-steps-getting-Tapestry-and-Hibernate-working-via-DAO-tp3072498p3204134.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
On Fri, 08 Oct 2010 04:07:16 -0300, ael alan-lua...@dash.com.ph wrote: So what would be the difference? The important is you achieve what you want to do. The difference is that the Tapestry-Hibernate integration (session and transaction handling) will not work if your DAO is not a Tapestry-IoC service. That simple. As Howard said, you don't need to use Tapestry-Hibernate. If you don't, then you need to handle sessions and transactions yourself. It's very important to achieve, but the way you achieve is is very important too. Messed up code, even when it works, has less value, as the only 100% sure thing in software development is that something will change. With well-written code, reacting to this changes is way faster, easier and needs less effort. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
have a look here, perhaps it helps you http://www.chenillekit.org/chenillekit-hibernate/dao_sample.html with regards Sven Homburg Founder of the Chenille Kit Project http://chenillekit.codehaus.org 2010/10/8 Alex W. Croton acro...@linkfinancial.eu: Many thanks to all who offered solutions on this one - I think I've got it cracked now. My problem was not so much in getting the code for the DAO working, it was the realisation that I could/needed to inject the Session into the DAO to be able to 'talk' to Hibernate, and to then inject the DAO into the component code - of course, this will probably prompt a you don't do it like that!! response, but if there's a better way, I still can't see it :-) Regards, Alex C -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 08 October 2010 12:53 To: Tapestry users Subject: Re: Early steps getting Tapestry and Hibernate working via DAO On Fri, 08 Oct 2010 04:07:16 -0300, ael alan-lua...@dash.com.ph wrote: So what would be the difference? The important is you achieve what you want to do. The difference is that the Tapestry-Hibernate integration (session and transaction handling) will not work if your DAO is not a Tapestry-IoC service. That simple. As Howard said, you don't need to use Tapestry-Hibernate. If you don't, then you need to handle sessions and transactions yourself. It's very important to achieve, but the way you achieve is is very important too. Messed up code, even when it works, has less value, as the only 100% sure thing in software development is that something will change. With well- written code, reacting to this changes is way faster, easier and needs less effort. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
On Fri, 08 Oct 2010 12:41:41 -0300, Rich M rich...@moremagic.com wrote: Hi, Hi! @CommitAfter protected void executeUpdate(Entity entity){ Have you tried making your method public? Another question: what Tapestry-IoC version are you using? Tapestry 5.1.0.5 didn't add annotations put in method implementations in the corresponding method in the created proxy, so @CommitAfter would only work if you put the annotation in an interface method. This was fixed in 5.2, I think. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
Hi, I'm using 5.1.0.5, good to know about the annotations for services. I modified my code so the Interfaces are using the @CommitAfter annotation for the desired methods. Also made those methods public (I wanted protected because the DAO class isn't supposed to be directly accessed except by extending classes). Still nothing changed though, it's not committing anything. It might be useful for me to explain a bit of how it all works: DAO interface has the @CommitAfter methods DAOImpl implements this and is an Abstract class EntityDAO interface is an interface for the methods of a DAO for Entity entity EntityDAOImpl implements EntityDAO and extends DAOImpl and its methods call the @CommitAfter methods from the DAOImpl AppModule binds the EntityDAO.class interface to the id EntityDAO Page Class @Inject EntityDAO and calls the method (say update() ) and in EntityDAO update() calls @CommitAfter public void executeUpdate() See anything wrong here? Thanks, Rich On 10/08/2010 12:10 PM, Thiago H. de Paula Figueiredo wrote: On Fri, 08 Oct 2010 12:41:41 -0300, Rich M rich...@moremagic.com wrote: Hi, Hi! @CommitAfter protected void executeUpdate(Entity entity){ Have you tried making your method public? Another question: what Tapestry-IoC version are you using? Tapestry 5.1.0.5 didn't add annotations put in method implementations in the corresponding method in the created proxy, so @CommitAfter would only work if you put the annotation in an interface method. This was fixed in 5.2, I think. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
On Fri, 08 Oct 2010 14:40:29 -0300, Rich M rich...@moremagic.com wrote: Hi, Hi! I'm using 5.1.0.5, good to know about the annotations for services. Please try 5.2 and tells us what happens. Your code seems OK to me. My architecture looks exactly like yours for DAOs. :) But I don't use tapestry-hibernate myself, so I cannot say anything 100% sure about it. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
Ah, darn it. This is for a vital product and my company wouldn't let me use 5.2 until its a final release. However, a little bit of digging I was able to improve on my previous code for 5.1.0.5. Albeit no @CommitAfter, but it does seem a better solution that using Transaction explicitly (which results in Tapestry-Hibernate exceptions). Basically replace Transaction with HibernateSessionManager injected into the constructor of the service. The instance I have is called hsm and you can see where I used it to replace Transaction txn. protected void executeUpdate(Entity entity){ try{ //txn = ses.beginTransaction(); System.out.println(In executeUpdate of DAO base class: about to commit a + entity.getClass().getName()); ses.update( (entity.getClass().cast(entity)) ); //Use reflection to cast the object correctly System.out.println(**Between ses.update and txn.commit**); hsm.commit(); //txn.commit(); System.out.println(**after txn.commit**); }catch(HibernateException he){ System.out.println(**Between ses.update and txn.rollback because of an exception! Exception: + he); hsm.abort(); //txn.rollback(); throw new DAOException(Could not commit the + entity.getClass().getName() + object!); }catch(ClassCastException cce){ System.out.println(**Between ses.update and txn.rollback because of an exception! Exception: + cce); hsm.abort(); //txn.rollback(); throw new DAOException(Could not commit the + entity.getClass().getName() + object! ClassCastException reflecting the entity.); } } Hopefully this is useful to some people trying to use Tapestry-Hibernate in 5.1.0.5, but also encountering issues with @CommitAfter and not liking the way Tapestry-Hibernate complains when you manage Transaction on your own. Once 5.2 comes out I'll try to remember to come back to this one and let you know about the @CommitAfter. Thanks for the help Thiago. -Rich On 10/08/2010 02:11 PM, Thiago H. de Paula Figueiredo wrote: On Fri, 08 Oct 2010 14:40:29 -0300, Rich M rich...@moremagic.com wrote: Hi, Hi! I'm using 5.1.0.5, good to know about the annotations for services. Please try 5.2 and tells us what happens. Your code seems OK to me. My architecture looks exactly like yours for DAOs. :) But I don't use tapestry-hibernate myself, so I cannot say anything 100% sure about it. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
On Fri, Oct 8, 2010 at 11:32 AM, Rich M rich...@moremagic.com wrote: Ah, darn it. This is for a vital product and my company wouldn't let me use 5.2 until its a final release. However, a little bit of digging I was able to improve on my previous code for 5.1.0.5. Albeit no @CommitAfter, but it does seem a better solution that using Transaction explicitly (which results in Tapestry-Hibernate exceptions). Basically replace Transaction with ... Hopefully this is useful to some people trying to use Tapestry-Hibernate in 5.1.0.5, but also encountering issues with @CommitAfter and not liking the way Tapestry-Hibernate complains when you manage Transaction on your own. Better do it right if you don't wish to heed the collective wisdom that is tapestry-hibernate and want to manage transactions yourself. Tapestry-Hibernate only complains if you are stealing the transaction that is supposed to be managed for you. There are perfectly valid cases where you want to manage the transactions, but you can also mix and match with managed and unmanaged transactions provided that you do it carefully. In principle, there are two cases: 1) If you want the transaction to participate in the same session, open a new transaction after you close the managed transaction - there can be more to commit in the same request cycle 2) For a background or a delayed operation, create a new session instead of trying to use the managed session (with HibernateSessionSource.create()) and manage transactions in that session yourself Kalle - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
This is my code in Hibernate returning LIST... Hibernate DAO public class TbCommandDAO { protected Session session; protected Transaction tx = null; public TbCommandDAO() { SessionFactory factory = HibernateUtil.getSessionFactory(); this.session = factory.getCurrentSession(); } public ListTbCommand getList(){ try { tx = session.beginTransaction(); Criteria crit = session.createCriteria(TbCommand.class); ListTbCommand results = (ListTbCommand) crit.list(); tx.commit(); return results; }catch (HibernateException e) { if (session.getTransaction().isActive()) { session.getTransaction().rollback(); } if (tx != null){ tx.rollback(); } return null; }finally { tx = null; } } } Page Class private TbCommandDAO tbcommanddao; public ListTbCommand getList(){ if(tbcommanddao == null) tbcommanddao = new TbCommandDAO(); ListTbCommand result = (ListTbCommand) tbcommanddao.getList(); return result; } Hope it can help you... -- View this message in context: http://tapestry.1045711.n5.nabble.com/Early-steps-getting-Tapestry-and-Hibernate-working-via-DAO-tp3072498p3203901.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
On Thu, 07 Oct 2010 21:20:11 -0300, ael alan-lua...@dash.com.ph wrote: This is my code in Hibernate returning LIST... Your code isn't using Tapestry-Hibernate nor Tapestry-IoC at all. Check the steps at http://tapestry.apache.org/tapestry5.1/tapestry-hibernate/userguide.html, section Managing Transactions using DAOs. Make your DAO implemenation a Tapestry-IoC service and inject a Session on it (through constructor or @Inject private Session session). -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
https://bitbucket.org/mgruca/tjug_tapestry_30.09.10/downloads That should run in eclipse with m2 plugin. Check it out, maybe it will help to find solution. In case if revision 9 wouldn't work, try previous one. Rev 9 are changes that I made during presentation, they should not affect anything, but I prefer to mention it just in case.a With regards Michał Gruca Alex W. Croton wrote: Hi, I am a real newbie when it comes to Tapestry and even worse than that when it comes to Hibernate. I am using Tapestry 5.1.0 and Hibernate 3.3.1 - talking to a MySQL database. I've got the code from the Tapestry5HowToUseTapestryHibernate working fine, but in the application that I am putting together I want/need to be able to use DAO to interface between the various components of the application. After 3 days of various Googling, I'm far more confused than when I started - it seems that the examples that I have been able to find are either for a different version of Tapestry - or appear to be using some form of magic that my environment is lacking :-) Can anyone offer any pointers to get me going on what 'bits' I need where please? Regards, Alex C -- View this message in context: http://tapestry-users.832.n2.nabble.com/Early-steps-getting-Tapestry-and-Hibernate-working-via-DAO-tp5591178p5601938.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
You do have if you have the tapestry-hibernate project open in eclipse and enabled maven workspace resolution. Then the tapestry-hibernate project is added to the classpath, not the jar and thus the META-INF entry to load the hibernate module isn't available. On 01.10.2010 18:55, Howard Lewis Ship wrote: That seems odd, you shouldn't need to use @SubModule; the necessary modules are automatically loaded if on the classpath. On Fri, Oct 1, 2010 at 6:31 AM, Michal Grucamichalgr...@gmail.com wrote: I gave presentation about Tapestry yesterday. In it I included hibernate integration example, I will share that after weekend. From my observation: make sure that You have both hibernate libraries in Your classpath. Double check did You annotated AppModule with @Submodule(HibernateModule.class). That are two related points that gave me a lot of trouble. Mainly because of eclipse weakest side: maven integration. -- View this message in context: http://tapestry-users.832.n2.nabble.com/Early-steps-getting-Tapestry-and-Hibernate-working-via-DAO-tp5591178p5591360.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
This was the most useful complete tutorial I used at the beginning what I started to learn Tapestry and needed to figure out how to include Hibernate. http://wiki.apache.org/tapestry/Tapstry5First_project_with_Tapestry5,_Spring_and_Hibernate So, now we use the standard source layout with the additions from the tutorial (so definitely read it first). Later after seeing that we don't need Spring at all, I removed it and did everything that Spring was doing myself and used what was already available in Tapestry for the rest. If you like inspect our source code here: http://develop.ii.edu.mk/projects/isii/browser/trunk The main package is mk.edu.ii.isii.upisi Most simple pages are DegreeList and DegreeEdit, there is also some transactional service code behind it in services. and some dao code behind the service code. Also inspect the AppModule to see how the wireing between the services is done. On 10/01/2010 02:40 PM, Alex W. Croton wrote: Hi, I am a real newbie when it comes to Tapestry and even worse than that when it comes to Hibernate. I am using Tapestry 5.1.0 and Hibernate 3.3.1 - talking to a MySQL database. I've got the code from the Tapestry5HowToUseTapestryHibernate working fine, but in the application that I am putting together I want/need to be able to use DAO to interface between the various components of the application. After 3 days of various Googling, I'm far more confused than when I started - it seems that the examples that I have been able to find are either for a different version of Tapestry - or appear to be using some form of magic that my environment is lacking :-) Can anyone offer any pointers to get me going on what 'bits' I need where please? Regards, Alex C smime.p7s Description: S/MIME Cryptographic Signature
Early steps getting Tapestry and Hibernate working via DAO
Hi, I am a real newbie when it comes to Tapestry and even worse than that when it comes to Hibernate. I am using Tapestry 5.1.0 and Hibernate 3.3.1 - talking to a MySQL database. I've got the code from the Tapestry5HowToUseTapestryHibernate working fine, but in the application that I am putting together I want/need to be able to use DAO to interface between the various components of the application. After 3 days of various Googling, I'm far more confused than when I started - it seems that the examples that I have been able to find are either for a different version of Tapestry - or appear to be using some form of magic that my environment is lacking :-) Can anyone offer any pointers to get me going on what 'bits' I need where please? Regards, Alex C
Re: Early steps getting Tapestry and Hibernate working via DAO
http://tapestry.apache.org/tapestry5/tapestry-hibernate/userguide.html Course I don't even use tapestry-hibernate at all, just the tapestry spring integration to inject spring/hibernate services. -- View this message in context: http://tapestry-users.832.n2.nabble.com/Early-steps-getting-Tapestry-and-Hibernate-working-via-DAO-tp5591178p5591251.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
On Fri, 01 Oct 2010 09:40:18 -0300, Alex W. Croton acro...@linkfinancial.eu wrote: Hi, Hi! After 3 days of various Googling, I'm far more confused than when I started - it seems that the examples that I have been able to find are either for a different version of Tapestry - or appear to be using some form of magic that my environment is lacking :-) See http://tapestry.apache.org/tapestry5.1/tapestry-hibernate/userguide.html. ;) Cheers! -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Early steps getting Tapestry and Hibernate working via DAO
Having now had two replies directing to the same page - which I've looked at _so many_ times over the last few days that I ought to have my own page counter - I'm coming to the conclusion that I must be brain dead and looking through the obvious! Thanks for the replies - I'll set a new Eclipse project up and have a play with just this code from fresh. Regards, Alex After 3 days of various Googling, I'm far more confused than when I started - it seems that the examples that I have been able to find are either for a different version of Tapestry - or appear to be using some form of magic that my environment is lacking :-) See http://tapestry.apache.org/tapestry5.1/tapestry-hibernate/userguide.html. ;) Cheers! -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Early steps getting Tapestry and Hibernate working via DAO
I gave presentation about Tapestry yesterday. In it I included hibernate integration example, I will share that after weekend. From my observation: make sure that You have both hibernate libraries in Your classpath. Double check did You annotated AppModule with @Submodule(HibernateModule.class). That are two related points that gave me a lot of trouble. Mainly because of eclipse weakest side: maven integration. -- View this message in context: http://tapestry-users.832.n2.nabble.com/Early-steps-getting-Tapestry-and-Hibernate-working-via-DAO-tp5591178p5591360.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Early steps getting Tapestry and Hibernate working via DAO
So, working through the code; I've built my own Person entity (and created it in the db) and have got the first stage of the example code working - I'm now getting to the 'Commiting Changes' part of the example. This has the following: @InjectPage Private PersonIndex personIndex; So ... what is this class (i.e. PersonIndex) and what does it need to do? It's obviously pretty critical, as it is the return from the onSuccess() method. Is this part of a larger example that I've not stumbled on? Sorry if this is totally obvious, but I'm just not getting it - and hey ... I haven't even got on to the DAO bit of the code yet! Regards, Alex Having now had two replies directing to the same page - which I've looked at _so many_ times over the last few days that I ought to have my own page counter - I'm coming to the conclusion that I must be brain dead and looking through the obvious! Thanks for the replies - I'll set a new Eclipse project up and have a play with just this code from fresh. See http://tapestry.apache.org/tapestry5.1/tapestry- hibernate/userguide.html. ;)
Re: RE: Early steps getting Tapestry and Hibernate working via DAO
PersonIndex is a page, probably listing all the people... On Oct 1, 2010 8:51 AM, Alex W. Croton acro...@linkfinancial.eu wrote: So, working through the code; I've built my own Person entity (and created it in the db) and have got the first stage of the example code working - I'm now getting to the 'Commiting Changes' part of the example. This has the following: @InjectPage Private PersonIndex personIndex; So ... what is this class (i.e. PersonIndex) and what does it need to do? It's obviously pretty critical, as it is the return from the onSuccess() method. Is this part of a larger example that I've not stumbled on? Sorry if this is totally obvious, but I'm just not getting it - and hey ... I haven't even got on to the DAO bit of the code yet! Regards, Alex Having now had two replies directing to the same page - which I've looked at _so many_ times over the last few days that I ought to have my own page counter - I'm coming to the conclusion that I must be brain dead and looking through the obvious! Thanks for the replies - I'll set a new Eclipse project up and have a play with just this code from fresh. See http://tapestry.apache.org/tapestry5.1/tapestry- hibernate/userguide.html. ;)
RE: RE: Early steps getting Tapestry and Hibernate working via DAO
Doh! Obviously looking for complexity ... and ignoring what the return value of onSuccess() is used for. Alex -Original Message- From: Josh Canfield [mailto:joshcanfi...@gmail.com] Sent: 01 October 2010 17:18 To: Tapestry users Subject: Re: RE: Early steps getting Tapestry and Hibernate working via DAO PersonIndex is a page, probably listing all the people... On Oct 1, 2010 8:51 AM, Alex W. Croton acro...@linkfinancial.eu wrote: So, working through the code; I've built my own Person entity (and created it in the db) and have got the first stage of the example code working - I'm now getting to the 'Commiting Changes' part of the example. This has the following: @InjectPage Private PersonIndex personIndex; So ... what is this class (i.e. PersonIndex) and what does it need to do? It's obviously pretty critical, as it is the return from the onSuccess() method. Is this part of a larger example that I've not stumbled on? Sorry if this is totally obvious, but I'm just not getting it - and hey ... I haven't even got on to the DAO bit of the code yet! Regards, Alex Having now had two replies directing to the same page - which I've looked at _so many_ times over the last few days that I ought to have my own page counter - I'm coming to the conclusion that I must be brain dead and looking through the obvious! Thanks for the replies - I'll set a new Eclipse project up and have a play with just this code from fresh. See http://tapestry.apache.org/tapestry5.1/tapestry- hibernate/userguide.html. ;) - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Early steps getting Tapestry and Hibernate working via DAO
That seems odd, you shouldn't need to use @SubModule; the necessary modules are automatically loaded if on the classpath. On Fri, Oct 1, 2010 at 6:31 AM, Michal Gruca michalgr...@gmail.com wrote: I gave presentation about Tapestry yesterday. In it I included hibernate integration example, I will share that after weekend. From my observation: make sure that You have both hibernate libraries in Your classpath. Double check did You annotated AppModule with @Submodule(HibernateModule.class). That are two related points that gave me a lot of trouble. Mainly because of eclipse weakest side: maven integration. -- View this message in context: http://tapestry-users.832.n2.nabble.com/Early-steps-getting-Tapestry-and-Hibernate-working-via-DAO-tp5591178p5591360.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org