T5: Hibernate

2007-09-09 Thread Angelo Chen
Hi, I searched the list to find a simple tutorial for Tapestry-hibernate, but couldn't find any, some quite simple, but source code not complete. any simple code there? anyway, I believe Hibernate can be used directly without Tapestry-hibernate module, my question now is, what are the advantages

Re: T5: Hibernate

2007-09-09 Thread Davor Hrg
not much at the moment, but it's simple to use, factories are created http://tapestry.apache.org/tapestry5/tapestry-hibernate/conf.html you just call @Inject private Session _session; or in the method Especialy if you have DAO's that have Session in constructor than you can configure them

Re: T5 on JDK 1.6 or newer

2007-09-09 Thread Stephan Schwab
Unfortunately yesterday we had to switch back to JVM 1.5, as the same symptoms have shown up again. Seems that there is still a problem and JVM 1.6. update 2 is not the solution. -- View this message in context: http://www.nabble.com/T5-on-JDK-1.6-or-newer-tf4324659.html#a12582298 Sent from the

Re: T5: Hibernate

2007-09-09 Thread Marcus Schmidke
I accidentally found this thread and also tried to get Hibernate integration running. Basically, it runs, but I still know too few about Tapestry basics. @Inject works fine for page components, but how can I make it work in other classes? Concretely, how can I inject a hibernate session into my

Re: T5: Hibernate

2007-09-09 Thread Davor Hrg
ok, pages you know now ... other time you create your classes is inside your module AppModule Tapestry-ioc subsystem is in charge here http://tapestry.apache.org/tapestry5/tapestry-ioc/ read this page to get more information on dependecy injection in general you will need this stuff often

Re: T5: Hibernate

2007-09-09 Thread Marcus Schmidke
Yes ... I've read ... parts of it more than once ... but unfortunately, I do not seem to be clever enough. I want to write a value encoder which maps Hibernate Entities to their IDs and vice versa. I've written - a HibernateValueEncoder - a HibernateValueEncoderFactory - an AppModule containing

[T5] How to use Services - an example, please

2007-09-09 Thread Erik Vullings
Hi, I've read the manual about services, but don't get it: It's like seeing the puzzle pieces, but not the whole. Can someone explain it to me please, especially: 1. How can I use a service to connect to my database? Or should I use Hibernate? 2. How can I use a service to access the

Re: T5: Hibernate

2007-09-09 Thread Marcus Schmidke
Ok ..., I took a shower which made things much much clearer. I think I should build and register a BusinessService (just like a stateless session bean) which encapsulates the Hibernate things. This Service can have the Hibernate Session injected on some different ways (just like explained in the

Re: T5: Hibernate

2007-09-09 Thread Marcus Schmidke
Still not in bed .. was too curious about that session thing. Adding this parameter indeed works - I get some kind of session object in the contribute method. But what session is this? Is it a session which is created at this moment (and is already closed when I really need it) or is it some kind

Re: T5: Hibernate

2007-09-09 Thread Lindsay Steele
Just by co-incidence, I am trying to get Hibernate working but I am getting the following error in the logs. 08:10:04.531 WARN!! [SocketListener0-1] org.hibernate.cfg.AnnotationBinder.bindPackage(AnnotationBinder.java:217) 90 Package not found or wo package-info.java:

Re: T5: Hibernate

2007-09-09 Thread Angelo Chen
Hi Davor, Thanks, as a newbie, i can't really understand it fully, here is what I got so far: 1) put that tapestry-hibernate.jar in the lib. 2) put all annotated entities in the entities direcotory 3) in your main source: @inject private Session _session; then? what's the Session of

Re: [T5] How to use Services - an example, please

2007-09-09 Thread smithfox
http://code.google.com/p/lichen-forum/ Erik Vullings-2 wrote: Hi, I've read the manual about services, but don't get it: It's like seeing the puzzle pieces, but not the whole. Can someone explain it to me please, especially: 1. How can I use a service to connect to my database?

Re: T5: Hibernate

2007-09-09 Thread Angelo Chen
Hi Davor, I read the doc and do the following: 1. put Fruit.java under entities package 2. put hibernate.cfg.xml under resources 3. in the Start.java, I add: @Inject private Session _session; String onAction() { Fruit f = new Fruit(); f.setName(Orange);

Re: T5: Hibernate

2007-09-09 Thread Jun Tsai
see your hibernate.cfg.xml file. Jun Tsai 2007/9/10, Angelo Chen [EMAIL PROTECTED]: Hi Davor, I read the doc and do the following: 1. put Fruit.java under entities package 2. put hibernate.cfg.xml under resources 3. in the Start.java, I add: @Inject private Session _session;

Re: T5: Hibernate

2007-09-09 Thread Angelo Chen
Hi Jun, I believe it has something to do with that, but which part? I use it in a java application, it works, that's what is puzzling me. A.C. Jun Tsai-2 wrote: see your hibernate.cfg.xml file. Jun Tsai 2007/9/10, Angelo Chen [EMAIL PROTECTED]: -- View this message in context:

Re: T5: Hibernate

2007-09-09 Thread Ulrich Stärk
The Hibernate mapping package=... configuration element doesn't expect a package with annotated classes as one might assume but expects an annotated package with package-level annotations like @GenericGenerator. So you must explicitly add every annotated class to your Hibernate configuration