Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » errors in entity classes generated from Table
errors in entity classes generated from Table [message #1063261] Wed, 12 June 2013 16:55 Go to next message
Victor Germain is currently offline Victor Germain
Messages: 2
Registered: June 2013
Location: Paris
Junior Member
Hi,

I have a MySQL database model deployed on a server and I'm trying to generate entity classes using "New -> JPA Entities From Tables".

It works OK for some of the tables but for other tables, the generated classes have errors.

Here is what I find in the generated classes:

Quote:
public ApportionmentDetail addApportionmentDetails(ApportionmentDetail $customizer.convertToSingularisedString($role.propertyName)) {
getApportionmentDetails().add($customizer.convertToSingularisedString($role.propertyName));
$customizer.convertToSingularisedString($role.propertyName).setApportionment(this);

return $customizer.convertToSingularisedString($role.propertyName);
}

public ApportionmentDetail removeApportionmentDetails(ApportionmentDetail $customizer.convertToSingularisedString($role.propertyName)) {
getApportionmentDetails().remove($customizer.convertToSingularisedString($role.propertyName));
$customizer.convertToSingularisedString($role.propertyName).setApportionment(null);

return $customizer.convertToSingularisedString($role.propertyName);
}


I find this 'behavior' for roughly 1/3 of the classes generated. I googled for it but nothing comes back Confused


As a general principles (following guidelines I found on the Web), all my tables have a 'id' pk field and to address relationship between the tables, I have set foreign keys on the child tables. For the above generated code, here are the tables involved:

index.php/fa/15236/0/
(The post preview doesn't display the image - if it persists after submitting, check the attached file)


Has someone already encountered this issue ? I'm sure I'm doing something wrong but it is several days I'm unsuccessfully trying to figure out where it is coming from Sad

Note I'm new to J2EE development and JPA and DALI tools etc.

Many thanks in advance for any hint you could provide me.

Regards,
Re: errors in entity classes generated from Table [message #1063692 is a reply to message #1063261] Thu, 13 June 2013 14:31 Go to previous messageGo to next message
Neil Hauge is currently offline Neil Hauge
Messages: 467
Registered: July 2009
Senior Member
It would appear that you have encountered a bug in the Dali entity generation code. This issue is likely more prevalent on a database such as MySQL (which has some interesting table/column case dynamics dependent on the OS.) My guess is you are encountering some delimiting which ends up escaping our template code. Could you please file a bug for this here:

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Dali%20JPA%20Tools

I'm not sure if there are a lot of great workaround without switching your OS or your database vendor. It does seem a little odd that this issue hasn't been reported before, so perhaps there is more to the story. Be sure to indicate in the bug what OS the MySQL database is running on as this makes a difference in the delimiting that would take place in a generated entity. Perhaps with more information on the bug we will be able to provide a suitable workaround until Kepler SR1 comes out. Thanks for reporting.

Neil

Re: errors in entity classes generated from Table [message #1063869 is a reply to message #1063692] Fri, 14 June 2013 11:22 Go to previous message
Victor Germain is currently offline Victor Germain
Messages: 2
Registered: June 2013
Location: Paris
Junior Member
Many thanks for your answer! I really appreciate the time you spend trying to help me (and the rest of the community of users).

As suggested, I have submitted the following bug: Bug 410826

For information, the issue first arised using a MySQL server hosted on my Synology NAS. Based on your comment, I deployed a fresh MySQL server instance (last version to date - 5.6.12) on my dev machine (Windows 8 ) but unfortunately it didn't help.


Do you think there are options I could tune to get around the problem (like changing the storage engine, the schema colletion character set, other)? All my schema is prepared using MySQL Workbench and therefore switching to another DB would be very painful :-s Any practical suggestion to move forward until this is fixed would be more than welcomed...

Victor

[Updated on: Fri, 14 June 2013 11:24]

Report message to a moderator

Previous Topic:Headless mode via ant or the like?
Next Topic:Dali 3.3 released with Kepler
Goto Forum:
  


Current Time: Mon Jul 28 08:31:59 EDT 2014

Powered by FUDForum. Page generated in 0.01721 seconds