package org.hibernate.auction.persistence; import net.sf.hibernate.cfg.NamingStrategy; import net.sf.hibernate.util.StringHelper; /** * Prefix database table and column names with a CaveatEmptor handle. *
* This is the implementation of a Hibernate NamingStrategy. * Hibernate calls this class whenever it creates the database schema. * All table names are prefixed with "CE_" while keeping the * default Hibernate of uppercase property names. To enable this strategy, * set it as the default for the SessionFactory , eg. in * HibernateUtil: *
*
* configuration = new Configuration(); * configuration.setNamingStrategy(new CENamingStrategy()); * sessionFactory = configuration.configure().buildSessionFactory(); * ** In general, NamingStrategy is a powerful concept that gives * you freedom to name your database tables and columns using whatever * pattern you like. * * @see HibernateUtil * @author Christian Bauer