Discussion:
[Middlegen-user] Re: middlegen-user digest, Vol 1 #373 - 2 msgs
Qin Ding
2003-07-22 14:23:34 UTC
Permalink
I am new to the middlegen. After downloaded the middlegen, I followed the
demo and get-start document. It looks great. I decided to learn more. I
used firebird as my business database. First I try the Employee.gdb, which
is the example database come along with the firebird download. Here is my
questions, problems and comments:

1. When loading many tables ( in hundreds in an enterprise information
system) into middlegen GUI, how do I hide and unhide the tables, so they
are not so crowded? Like in Microsoft Access DB Relationship view.

2. If there are no relationships shown between two tables as in GUI, is
there a way I can draw a line to build the relationships like in Microsoft
Access DB Relationship view.?

3. In firebird, when a data type is SmallInt, it is mapped to
java.lang.Short. What is the mapping file used and where is it located if
I use JBoss as my App Server?

4. In firebird, a trigger is used to populate the primary key (type of
smallint). How do I tell middlegen not to populate the bean id field,
because when the bean get saved to the database, I guess the key is
automatically generated by the trigger.

5. Because the pk field is smallint -> Short, I received the error
Short(int) can't be resolved. Middlegen sequenceGenerator generates an id
of type int, which is a param passed to the Short constructor. I have to
use the middlegen GUI to change all key field (pk and fk) from smallint to
int, the error goes away. However, I am worried that in database the type
remains as smallint, in java object it is int. What happens when the id
get very big for the smallint to hold?

6. Is there an easy way to make changes from one type to another in GUI or
in ant task? If I have over hundred tables and much more fields from
existing enterprise database, I feel we can configure the middlegen to take
int type whenever it finds a smallint.

7. In db, I have a country table, which is referenced by several tables.
When I compile the java source, I get an error stating that getCountry is
already defined. Same in department table which is referenced by many
tables. The error states that getDepartment() is already defined. Because
I do not write any business code in this exarcise, every thing is generated
by middlegen by reading in database meta info, it makes wonder I perhaps
have to adjust the relationships somehow. I don't know what and how,
though. What's the problem here? And where I should look in order to avoid
this problem?

8. Where can I find the document (a complete user guide) on all the
relationship attribute like (many2many). What else do we have (one2one,
one2many)?

9. I heard that in middlegen next version includes a hibernate plug-in?
How soon the next version will be released?

It is a great tool. Keep up the good work.

Qin
----------------------------------------------------------------------------------------

This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit written
agreement or government initiative expressly permitting the use of e-mail
for such purpose.
----------------------------------------------------------------------------------------
Aslak Hellesøy
2003-07-22 18:55:12 UTC
Permalink
Post by Qin Ding
I am new to the middlegen. After downloaded the middlegen, I followed the
demo and get-start document. It looks great. I decided to learn more. I
used firebird as my business database. First I try the Employee.gdb, which
is the example database come along with the firebird download. Here is my
Hi Qin.

I have tried to answer some of your questions. I hope someone else on
this list can fill in the missing parts.
Our bug tracker is currently at:
http://jira.codehaus.org/secure/BrowseProject.jspa?id=10110
Post by Qin Ding
1. When loading many tables ( in hundreds in an enterprise information
system) into middlegen GUI, how do I hide and unhide the tables, so they
are not so crowded? Like in Microsoft Access DB Relationship view.
This is currently not supported. Please file a feature request.
Post by Qin Ding
2. If there are no relationships shown between two tables as in GUI, is
there a way I can draw a line to build the relationships like in Microsoft
Access DB Relationship view.?
Declaring relationship after scanning is currently not supported.
However, you can use the crossref Ant element to declare relations that
are not declared (as foreign key references) in your database. If you
want to be able to do this in the GUI, please file a feature request.
Post by Qin Ding
3. In firebird, when a data type is SmallInt, it is mapped to
java.lang.Short. What is the mapping file used and where is it located if
I use JBoss as my App Server?
The mapping logic is in Sql2Java.java (http://tinyurl.com/hq0v)
Post by Qin Ding
4. In firebird, a trigger is used to populate the primary key (type of
smallint). How do I tell middlegen not to populate the bean id field,
because when the bean get saved to the database, I guess the key is
automatically generated by the trigger.
Supposing you're using Middlegen to generate CMPs, try one of the three
built-in pk generation schemes:
http://boss.bekk.no/boss/middlegen/plugins/cmp20.html
If that doesn't work for you, please file a deature request.
Post by Qin Ding
5. Because the pk field is smallint -> Short, I received the error
Short(int) can't be resolved. Middlegen sequenceGenerator generates an id
of type int, which is a param passed to the Short constructor. I have to
use the middlegen GUI to change all key field (pk and fk) from smallint to
int, the error goes away. However, I am worried that in database the type
remains as smallint, in java object it is int. What happens when the id
get very big for the smallint to hold?
6. Is there an easy way to make changes from one type to another in GUI or
in ant task? If I have over hundred tables and much more fields from
existing enterprise database, I feel we can configure the middlegen to take
int type whenever it finds a smallint.
7. In db, I have a country table, which is referenced by several tables.
When I compile the java source, I get an error stating that getCountry is
already defined. Same in department table which is referenced by many
tables. The error states that getDepartment() is already defined. Because
I do not write any business code in this exarcise, every thing is generated
by middlegen by reading in database meta info, it makes wonder I perhaps
have to adjust the relationships somehow. I don't know what and how,
though. What's the problem here? And where I should look in order to avoid
this problem?
8. Where can I find the document (a complete user guide) on all the
relationship attribute like (many2many). What else do we have (one2one,
one2many)?
9. I heard that in middlegen next version includes a hibernate plug-in?
How soon the next version will be released?
There is no schedule, but we're working on it. Maybe in a 2-3 months.
Post by Qin Ding
It is a great tool. Keep up the good work.
Thanks,
Aslak
Post by Qin Ding
Qin
----------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit written
agreement or government initiative expressly permitting the use of e-mail
for such purpose.
----------------------------------------------------------------------------------------
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
--
http://blogs.codehaus.org/people/rinkrank/
Loading...