| Author |
Message |
|
2007/10/08 16:45
|
|
|
Mikhail
Joined: 2007/08/30
Messages: 12
Offline
|
|
|
|
Hi
While generating Java code for a self many-to-many relationship depicted in the attached diagram with parameters shown in the attached screen copy the DBVA code generator fails to distinguish between the two instances of PERSON in the Person_has_lendersProcessor.java.
The two generated instances appear with the same name as shown below:
import org.orm.PersistentException;
/**
* ORM-Persistable Class
*/
public class Person_has_lendersProcessor {
...
private int personid;
public void setPersonid(int value) {
this.personid = value;
}
public int getPersonid() {
return personid;
}
private int personid;
public void setPersonid(int value) {
this.personid = value;
}
public int getPersonid() {
return personid;
....
This leads to the following compilation errors:
src/Person_has_lendersProcessor.java:49: personid is already defined in Person_has_lendersProcessor
private int personid;
^
src/Person_has_lendersProcessor.java:51: setPersonid(int) is already defined in Person_has_lendersProcessor
public void setPersonid(int value) {
src/Person_has_lendersProcessor.java:55: getPersonid() is already defined in Person_has_lendersProcessor
public int getPersonid() {
^
Advice, comments appreciated.
Best regards
Mikhail
Attached Image :
No description given
(12 kb)
Attached Image :
No description given
(75 kb)
|
|
|
|
 |
| |
|
2007/10/08 17:06
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
Hi Mikhail,
Thank you for your report. We are now investigating the problem. When there is any news, we'll let you know.
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/10/08 17:32
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
Hi Mikhail,
We were unable to reproduce your problem. Could you send me your project? I suggest you not to post here. You may send to my Email address:
jick@visual-paradigm.com
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/10/08 17:38
|
|
|
Mikhail
Joined: 2007/08/30
Messages: 12
Offline
|
|
|
|
Do you have the JSP Sample checked?
If so, could you post your Person_has_lendersProcessor.java.
Best regards
Mikhail
|
|
|
|
 |
| |
|
2007/10/08 17:39
|
|
|
Mikhail
Joined: 2007/08/30
Messages: 12
Offline
|
|
|
|
|
Note also that the SMART association should be selected.
|
|
|
|
 |
| |
|
2007/10/08 17:40
|
|
|
Mikhail
Joined: 2007/08/30
Messages: 12
Offline
|
|
|
|
|
The project is just this diagram. Nothing else to send.
|
|
|
|
 |
| |
|
2007/10/08 17:49
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
Dear Mikhail,
If sync the ERD to Class Diagram, it should be only 1 class Person with 1 self many-to-many association, which result in generating one jsp file (PersonProcessor) only, and should not generate Person_has_lendersProcessor.java. Our project is attached.
Can you send me yours?
Best regards,
Jick
| Description |
|
Download
|
| Filesize |
28 kb
|
| Downloaded: |
87 time(s) |
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/10/08 18:00
|
|
|
Mikhail
Joined: 2007/08/30
Messages: 12
Offline
|
|
|
|
Try adding an attribute to the person_has_lenders table in your ERD, e.g., a date, as shown in my original diagram.
The class diagram and the generated file set will be different then, isn't it?
|
|
|
|
 |
| |
|
2007/10/09 19:15
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
|
 |
| |
|
2007/10/09 23:38
|
|
|
Mikhail
Joined: 2007/08/30
Messages: 12
Offline
|
|
|
|
Jick, could you also provide a patch for Mac OS. Thank you.
Mikhail
|
|
|
|
 |
| |
|
2007/10/10 08:16
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
|
 |
| |
|
2007/10/10 14:53
|
|
|
Mikhail
Joined: 2007/08/30
Messages: 12
Offline
|
|
|
|
Jick
Thank you for this fix. There is more to this, however.
Have you tried to compile the project after this issue was fixed?
Personally, I could not compile it with 22 errors returned. All errors are related to one point: Methods are defined in the DAO objects of the Person and Person_has_lenders objects while the generated code assumes they are declared in the objects themselves.
For example, loadPersonByORMID is declared and implemented in PersonDAO and PersonDAOImpl correspondingly while the generated code attempts to call it via Person (see below).
Since this is just generated code, not a single line was added, I assume the generation procedure needs some more attention.
Could you look into it and advice? Thank you.
Best regards
Mikhail
src/person/PersonProcessor.java:73: cannot find symbol
symbol : method loadPersonByORMID(int)
location: class person.Person
person.Person _person =person.Person.loadPersonByORMID(getId());
src/person/PersonProcessor.java:88: cannot find symbol
symbol : method createPerson()
location: class person.Person
person.Person _person = person.Person.createPerson();
src/person/PersonProcessor.java:90: cannot find symbol
symbol : method save()
location: class person.Person
if (_person.save()) {
^
src/person/PersonProcessor.java:103: cannot find symbol
symbol : method loadPersonByORMID(int)
location: class person.Person
person.Person _person= person.Person.loadPersonByORMID(getId());
.....
src/person/Person_has_lendersProcessor.java:80: cannot find symbol
symbol : method createPerson_has_lenders()
location: class person.Person_has_lenders
person.Person_has_lenders _person_has_lenders = person.Person_has_lenders.createPerson_has_lenders();
^
src/person/Person_has_lendersProcessor.java:82: cannot find symbol
symbol : method save()
location: class person.Person_has_lenders
if (_person_has_lenders.save()) {
^
src/person/Person_has_lendersProcessor.java:95: cannot find symbol
symbol : method loadPersonByORMID(int)
location: class person.Person
person.Person_has_lenders _person_has_lenders= person.Person_has_lenders.loadPerson_has_lendersByORMID(person.Person.loadPersonByORMID(getBorrower_personid()), person.Person.loadPersonByORMID(getLender_personid()));
|
|
|
|
 |
| |
|
2007/10/10 18:18
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
Hi Mikhail,
Sorry about this. I'll check with our engineers and then come back to you as soon as possible.
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/10/17 17:12
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
|
 |
| |
|
2007/10/17 18:11
|
|
|
Mikhail
Joined: 2007/08/30
Messages: 12
Offline
|
|
|
|
Any hint why you have selected to restrict this? Just to understand the problem better...
Could you also provide a patch for Mac OS. Thank you.
Mikhail
|
|
|
|
 |
| |