Hi,

I also had some trouble configuring hibernate, my session was also null.

After searching for a while I found this tutorial:
http://linuxboy.javaeye.com/blog/68311


Since I dont use a DAO, my code looks something like the following.


my db entity:
...

import org.hibernate.Session;

@Entity
@Table(name = "EVENT")
public class EventDBEntity {
    public EventDBEntity() {}
    public EventDBEntity(Session session) {_session = session;}
    @Transient
    private Session _session;
    // more stuff here.. methods to access the db
...


in my appmodule.java:

...

    public static void bind(ServiceBinder binder)
    {
        binder.bind(TourDBEntity.class);
    }
...


then I call an @Inject on the db-entity:
...
    // db entity object
    @Inject
    private EventDBEntity _dbEntity;

    // now tapestry injects the hibernate session in my _dbEntity
...

Hope this helps!

Greetings, Mark

--
Mark Weißenberg
Tel. +49 228 9599630
startext Unternehmensberatung GmbH
Kennedyallee 2, D-53175 Bonn
Geschäftsführer Paul Bantzer, HRB Bonn 2741
Sitz der Gesellschaft: Bonn

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to