For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 8 replies, 4 voices, and was last updated 21 years, 11 months ago by
support-jeff.
-
AuthorPosts
-
oertigMemberHi,
If I try to generate the Hibernate mapping file with the wizard “Export trough Hibernate…” a wrong proprty type is generated.
The field in the database is defined as Integer or Int(10).
This field will be generated as java.lang.String if “Key Field Type” in the wizard is set to Java-Types, or as serialiazable it it is set to Hibernate-Types.
<property name=”mftUc” column=”MFT_UC” type=”java.lang.String” length=”10″ not-null=”true”/>
<property name=”mftUc” column=”MFT_UC” type=”serializable” length=”10″ not-null=”true”/>The java attributes resulting from this mapping file will be of the type java.lang.String or java.io.Serializable.
What did I wrong? What can I do that the wizard will correctly will generate a field of Type long or Long?
I’M using Eclipse 3.0 and MyEclipse Build 200407091200-3.8-Beta2
Thanks for the help.
Werner
August 2, 2004 at 9:08 am #211296
Riyad KallaMemberWerner,
I’ve asked our Hibernate dev to look at this.August 2, 2004 at 5:30 pm #211348
support-jeffMemberWerner –
You actually have to specify the id type in the wizard (combo select under the java vs hibernate type radio buttons) – this is a limitation/bug in the plugin on which the MyEclipse DB Explorer is based.
If you wait for 3.8 GA, you will no longer have to performa that useless task – the plugin figures it out for you (even composite ids) 😉
September 4, 2004 at 2:45 am #214558Hi Jeff,
I’m using 3.8.1 and having problems translating primary key types when exporting tables through Hibernate. I’m using MySQL (4.0) and my keys are BigInt (20) unsigned. The resulting Java property is always java.lang.String. I’ve seen this come up in another post and the solution was to manually update both the mapping files and your Java classes. Can you tell me if there is a template I can change somewhere that will use java.lang.Integer for ID properties instead?
-Thank you
September 4, 2004 at 6:41 am #214562
support-jeffMemberThe templates pretty much cover syntax/format, not the logic. This seems to be an issue for MySQL. The basic logic is: get table metadata, for each column get java.sql.Type, perform relatively simple mapping (so I suspect that the SQL types getting returned are off for some reason).
September 4, 2004 at 10:25 am #214569I’ve read elsewhere that there is a problem displaying MySQL foreign keys is the Database Explorer perspective (please see http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-2881.html ). Are these two issues related? Does the Hibernate mapping generator depend on the database explorer somehow? Is it a MySQL driver issue? It would be great if you found the bug that is causing this database metadata to disappear.
September 6, 2004 at 10:47 pm #214654
support-jeffMembertarantula –
Are these still an issue for you, or does the newly release Connector/J release (3.0.15-prod) fix them for you. The release appears to address a large number of db metadata related issues.
September 7, 2004 at 12:37 am #214657Amazing. The Hibernate plugin works perfectly for me now. Thanks for the tip!
I still have an issue with the Table Info view of the DB Explorer. Foreign keys are still not being listed, although indexes and primary keys are showing up fine. Any suggestions on how to get ME to use the new Connector/J driver, or is something else causing this?
September 7, 2004 at 7:04 am #214671
support-jeffMemberIt’s a bug. I will probably be addressing this for 3.8.2. If not that release then 3.9 definitely
-
AuthorPosts

