-->
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.  [ 5 posts ] 
Author Message
 Post subject: JBossIDE 1.5 Milestone 1. Eclipse
PostPosted: Wed Jun 08, 2005 10:29 pm 
Newbie

Joined: Tue May 31, 2005 12:25 am
Posts: 3
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: hibernate3.jar

Mapping documents:
-------------file 1---
<?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>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/jboss11</property>
<property name="hibernate.cglib.use_reflection_optimizer">true</property>
<property name="hibernate.connection.password">11user</property>
<property name="hibernate.connection.username">jboss11user</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<mapping resource="com/web11/User.hbm.xml" />
</session-factory>
</hibernate-configuration>


----file1 end-------------




-----------file2----------
<?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>
<!--
Auto-generated mapping file from
the hibernate.org cfg2hbm engine
-->
<class name="com.web11.User" table="user" catalog="">
<id name="Userid" type="java.lang.String">
<column name="USERID" scale="32" precision="0" not-null="true" sql-type="varchar" />
<generator class="assigned" />
</id>
<property name="Password" type="java.lang.String">
<column name="password" scale="41" precision="0" not-null="false" sql-type="varchar" />
</property>
<property name="Clientid" type="java.lang.String">
<column name="CLIENTID" scale="128" precision="0" not-null="false" sql-type="varchar" />
</property>
</class>
</hibernate-mapping>


---------file2 end-----




Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:MySQLServer41

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

I downloaded/installed the file from
http://www.jboss.org/products/jbosside
JBossIDE-1.5M1-jre15-win32.zip 1.5 3.1M5a
"Windows Platform.---This zip contains a completely self-contained
distribution of JBossIDE 1.5 Milestone 1. Eclipse is bundled with this
release. This bundle requires a 1.5 JRE and includes our EJB3 Tools. "

Application server I am using jboss-3.2.6.zip.
OS is Windows 2000 server and j2sdk1.4.2_06.

It is working well so that I could create hibernate.cfg.xml.
I could also reverse engineering from my database(MySQLServer41) tables to generate
Java classes as well as all the .hbm.xml files. One of them is a small
table called User.hbm.xml.

Now I switch to Hibernate Console Perspective, and in HQL Editor, I
type: select u.Userid from User as u (Userid is one of the field of the
table User). Then I got
error---org.hibernate.exception.SQLGrammarException: could not execute
query.


I am actually following the web demo step by step. So I am not sure what I did wrong.


NIE

_________________
NIE


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 12:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I remember answering this question...


anyway... try: select u.userid from User as u


Top
 Profile  
 
 Post subject: I did try but not working
PostPosted: Thu Jun 09, 2005 12:20 pm 
Newbie

Joined: Tue May 31, 2005 12:25 am
Posts: 3
David,
I did try per your instruction, but got error too.

I will double check all my xml files too, and try again.

NIE

_________________
NIE


Top
 Profile  
 
 Post subject: fixed
PostPosted: Tue Jun 14, 2005 1:18 am 
Newbie

Joined: Tue May 31, 2005 12:25 am
Posts: 3
It works now afterI remove the catalog name (which was blank, catalog="") in the .hbm.xml files.

_________________
NIE


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 14, 2005 1:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Yes that bug has been reported before. Looks like its back :-). I know Max is aware of it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.