258 APPENDIX A n MORE ADVANCED FEATURES APPENDIX (Net web server)

258 APPENDIX A n MORE ADVANCED FEATURES APPENDIX A n MORE ADVANCED FEATURES protected String getName() { return name; } protected void setName(String name) { this.name = name; } protected String getSeat() { return seat; } protected void setSeat(String seat) { this.seat = seat; } private String seat; private String name; } Interceptors have to override the org.hibernate.Interceptor interface. You can set a global interceptor for the configuration (see Listing A-25), or you can apply interceptors on a per-session basis. You have to install the interceptor programmatically there is no syntax for specifying this in the Hibernate configuration file. Listing A-25. Installing a Global Interceptor package com.hibernatebook.advanced.events; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; public class MailingExample { public static void main(String[] argv) { Configuration config = new Configuration(); // Apply this interceptor at a global level… config.setInterceptor(new BookingInterceptor()); SessionFactory factory = config.configure().buildSessionFactory(); Session session = factory.openSession(); // A local interceptor could alternatively // be applied here: // session.setInterceptor(new BookingInterceptor());
You want to have a cheap webhost for your apache application, then check apache web hosting services.

Leave a Reply