For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 55 replies, 10 voices, and was last updated 20 years, 9 months ago by
Christopher Marsh-Bourdon.
-
AuthorPosts
-
November 13, 2004 at 11:41 am #219465
support-jeffMemberPlease clarify “same behavior”…what is happening in your case. I think the FK panel bug was resolved in 3.8.2. If not, the next release will be soon (early-December).
November 13, 2004 at 1:20 pm #219467Apologies, the behaviour is thus:
When viewing tables within the “Table Info” view, the “Foreign Keys” tab never shows the foreign keys. This I believe has a knock on affect; when running the Hibernate Wizard it will bring across the table information but if table A has a foreign key to table B, denoted by a Integer key, it will not create the object reference (to a table B object) in table A, it will just use an Integer.
Now, I’m relatively new to Hibernate and MyEclipse, but using it on a PC and connecting to a MSSQL database (yesterday at the office) and doing the exact same steps, it worked. In my investigation I found a funny thing in the .hbm file, in that regardless to what I selected, the generator is always blank:
<id name="id" column="id" type="java.lang.Integer"> <generator class=""/> </id>
I’m not sure this has *any* bearing, but I recall it had a value when I did it at the office. I’ll verify this on Monday.
Thank you for your very quick response, and I hope this rather garbbled information helps.
Cheers
Christopher
November 13, 2004 at 5:16 pm #219469
support-jeffMemberMaybe I am not recalling properly, but the version of MySQL you are using does not support foreign keys. From the MySQL docs:
Starting from MySQL 3.23.44, InnoDB features foreign key constraints.
And, yes, this will affect how the Hibernate tool maps the objects generated. Please do verify the id generator issue, and attach any error logs that are associated with it.
November 13, 2004 at 5:45 pm #219470Yes, you are correct about only InnoDB allowing foreign keys, but this DB and all it’s tables are InnoDB and they all have foreign keys. The 3.06/3.0.15 refers to the MySQL Driver (Connector/J) not the database, I am using MySQL 4.0.15.
Sorry for the confuusion.
November 13, 2004 at 6:12 pm #219471
support-jeffMemberOk, that makes more sense. However, I still contend that this bug was fixed in 3.8.2. Could you see if any errors are being logged relating to the DB Explorer plugin? Also, please forward the build number for MyEclipse that you have installed (Help->About Eclipse Platform and then click on the MyEclipse icon; look for “Build id”).
November 14, 2004 at 2:59 am #219474Version: 3.8.2
Build id: 200409171200-3.8.2I can find no logs relevant to this view/driver. I’ve tried “Console” and all the directories (Eclipse/MyEclipse…).
November 14, 2004 at 3:21 pm #219475
support-jeffMemberCannot understand it. Possibly not the same issue then, since the previous bug was resolved in 3.8.2. Could you attach the DDL for the table/fk definition?
November 14, 2004 at 3:41 pm #219476Jeff, please bear with my ignorance, but where would I get the DDL?
Another thing I have noticed under the “DB Connection Info” view is that regardless of the drivers I select, the “Driver Version” for connection toi this database is “3.1.0-alpha…”. It never changes, regardless to whatever driver I use to setup the connection. I presume this would have some bearing, no?
Off to bed now in Blighty, thanks for all the help so far.
Night
Christopher
November 16, 2004 at 8:32 am #219532After having a fiddle with the drivers on Mac OS X and gettign not much further along the way, I have just tried on an XP box using MySQL Connector/J 3.0.15 (3.0.16 is out later today as well). And using the same database/tables/FKs it works perfectly.
I think the issue is with the MyEClipse ‘DB Browser’ setup, in that it does nto make a difference if you try and use a seperate MySQL driver (specified in the Connection setup) it will always use its default one (in my installation that is 3.0.10). This can be plainly seen after adding a seperate driver, open a connection and then navigating to the ‘DB Connection Info’ view.
Jeff, is the a way to force MyEclipe to use the non-default MySQL driver?
Either way, I now have my correct Hibernate Abstract classes, it is just a shame I had to ressurect an old PC to get the job done 🙁
November 16, 2004 at 8:35 am #219533
Riyad KallaMemberJeff, is the a way to force MyEclipe to use the non-default MySQL driver?
On the “Extra Class Path” tab when setting up a driver, when you add the JARs, in the dropdown box below you can either select the driver name OR type one in manually, if you need to use a different driver name just type it in here.
November 16, 2004 at 9:00 am #219542Riyad, you are right, and that was exactly what I did, but I selected a “New” jar and then listed it’s drivers. Once selected, and used, MyEClipse continued to use it’s default MySQL driver, not the one I pointed to.
-
AuthorPosts