a sample hibernate.cfg.xml I acquired about a year ago

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd";>

<hibernate-configuration>
    <session-factory>

        <!-- Database connection settings -->
        <property 
name="connection.driver_class">org.hsqldb.jdbcDriver</property>
       <!-- obviously mysql -->
        <property 
name="connection.url">jdbc:mysql://localhost:3306/jboss</property>
        <property name="connection.username">sa</property>
        <property name="connection.password">password</property>

        <!-- JDBC connection pool (use the built-in) -->
        <property name="connection.pool_size">1</property>

        <!-- SQL dialect -->
        <property name="dialect">org.hibernate.dialect.HSQLDialect</property>

        <!-- Enable Hibernate's automatic session context management -->
        <property name="current_session_context_class">thread</property>

        <!-- Disable the second-level cache  -->
        <property 
name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

        <!-- Echo all executed SQL to stdout -->
        <property name="show_sql">true</property>

        <!-- Drop and re-create the database schema on startup -->
        <property name="hbm2ddl.auto">create</property>

        <mapping resource="events/Event.hbm.xml"/>
        <mapping resource="events/Person.hbm.xml"/>

    </session-factory>

</hibernate-configuration>

and Here is Event.hbm.xml which illustrates  table and columns from DB Schema
and their associated name mappings e.g. EVENTS.EVENT_DATE becomes date

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd";>

<hibernate-mapping>

    <class name="events.Event" table="EVENTS">
        <id name="id" column="EVENT_ID">
            <generator class="native"/>
        </id>
        <property name="date" type="timestamp" column="EVENT_DATE"/>
        <property name="title"/>

        <set name="participants" table="PERSON_EVENT" inverse="true">
            <key column="EVENT_ID"/>
            <many-to-many column="PERSON_ID" class="events.Person"/>
        </set>
    </class>

</hibernate-mapping>

please ping me offline as hibernate is not specifically related to Struts

Martin Gainty 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




> Date: Tue, 6 Jan 2009 09:44:40 -0500
> From: newton.d...@yahoo.com
> To: user@struts.apache.org
> Subject: Re: configuration information from hibernate.cfg.xml
> 
> elyes sallem wrote:
> > any one know how get back hibernate configuration information from
> > hibernate.cfg.xml, like the bd server, schema ...
> 
> You might have better luck asking in a Hibernate-related list (this is 
> actually a Struts list).
> 
> Dave
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_________________________________________________________________
Send e-mail anywhere. No map, no compass.
http://windowslive.com/oneline/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_anywhere_122008

Reply via email to