-->
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.  [ 1 post ] 
Author Message
 Post subject: Help
PostPosted: Wed Nov 23, 2011 12:45 pm 
Newbie

Joined: Wed Nov 23, 2011 12:37 pm
Posts: 1
Good evening. I'm new user with hibernate and I need change all my project and put hibernate.

I have next doubts:


1- How could I put the password and user from my java application to hibernate.hbm.xml file.

Right now I have this:
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/clinica</property>
<property name="hibernate.connection.username">clinica</property>
<property name="hibernate.connection.password">clinica</property>
<property name="hibernate.show_sql">true</property>
<mapping resource="hibernate/Param.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Bu I would like pass user and password data from my java application.

2- The second doubt, how could I declare a compose key for a class definition, in the next text the key is "cod" but if I need declare cod+dni, how could I do it?

<id name="cod" type="string">
<column name="cod" length="3" />
<generator class="assigned" />
</id>

3- ¿What is better to use xml file or anotations?

4- Between criteria, HQL and SQL what do you recomendate me?

5- ¿How could I check if a database exist from hibernate code?

Excuse me for the long text.
Thank you very much


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

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.