-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: How do I map my queries in hibernate.cfg.xml
PostPosted: Thu Sep 11, 2003 7:18 pm 
Newbie

Joined: Thu Aug 28, 2003 3:58 pm
Posts: 19
Sorry if this is a basic question. But I'm trying to find any references on the docs and I can't find them.

This is my xml so far

Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 2.0//EN"

"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>

    <!-- a SessionFactory instance listed as /jndi/name -->
    <session-factory>

        <!-- properties -->
        <property name="query.imports">net.sf.hibernate.test, net.sf.hibernate.eg</property>
        <property name="dialect">net.sf.hibernate.dialect.PostgreSQLDialect</property>
        <property name="connection.driver_class">org.postgresql.Driver</property>
        <property name="connection.url">jdbc:postgresql:recjug</property>
        <property name="connection.username">postgres</property>
        <property name="connection.password">postgres</property>
        <property name="query.substitutions">yes 'Y', no 'N'</property>
        <property name="connection.pool_size">10</property>
        <property name="statement_cache.size">25</property>
        <property name="proxool.pool_alias">pool1</property>
        <property name="show_sql">true</property>
        <property name="jdbc.batch_size">0</property>
        <property name="jdbc.use_streams_for_binary">true</property>

        <!-- mapping files -->
        <mapping resource="br/org/recjug/site/entities/Group.hbm.xml"/>
        <mapping resource="br/org/recjug/site/entities/Permission.hbm.xml"/>
        <mapping resource="br/org/recjug/site/entities/User.hbm.xml"/>
    </session-factory>
</hibernate-configuration>


Where should I place my queries, like in the example

Code:
<query name="eg.DomesticCat.by.name.and.minimum.weight"><![CDATA[
    from eg.DomesticCat as cat
        where cat.name = ?
        and cat.weight > ?
] ]></query>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 11, 2003 7:31 pm 
Newbie

Joined: Thu Aug 28, 2003 3:58 pm
Posts: 19
<!ELEMENT hibernate-mapping (meta*, import*, class*, query*)> from the mapping DTD.

Geeeezzzzz should I put my queries in the mapping xml????????

/me blushes!!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.