Discussion:
[Middlegen-user] Middlegen 2.1 and an int and java.lang.Integer interface incompatibility
Terry W
2004-10-06 00:38:10 UTC
Permalink
Hi, I'm new to Middlegen and I'm real excited to use it.

I am taking an existing MySQL 4.0 database from an opensource project,
Coppermine, and I am running Middlegen against it to see how to use
Middlegen.

I am having a problem where an interface expects a wrapper class but
it is receiving a primitive variable.

I've seen messages posted about modifying the Sql2Java.java class and
messages about foreign keys of one class are accidentally named the
same as a key in another class of a different type, or there abouts.

I really haven't seen a definitive answer to this question other than
modifying the Sql2Java.java class or modifying a velocity template
file. By the way, which I don't see where in Middlegen 2.1 where I
would modify the primitive to wrapper classes in the velocity files.

If there are some other early adopter of Middlegen 2.1 who have also
seen the same problem please let me know what the workaround was.

-Terry

.
</snip>
.
.
webdoclet:
[webdoclet] Generating web.xml.

compile-adapter:
[javac] Compiling 17 source files to
/home/terry/middlegen-2.1/samples/build/classes
[javac] /home/terry/middlegen-2.1/samples/build/gen-src/airline/adapter/StrutsCpg131AlbumDelegate.java:108:
findByVisibility(int) in airline.interfaces.Cpg131AlbumFacade cannot
be applied to (java.lang.Integer)
[javac]
retVals.addAll(airline.interfaces.Cpg131AlbumFacadeUtil.getHome().create().findByVisibility(cpg131AlbumForm.getVisibility()));
[javac]
.
.
</snip>
.
[javac] /home/terry/middlegen-2.1/samples/build/gen-src/airline/adapter/TranslatorUtil.java:453:
setParent(java.lang.Integer) in airline.web.struts.Cpg131CategoryForm
cannot be applied to (int)
[javac]
cpg131CategoryForm.setParent(cpg131CategoryPersistence.getParent());
[javac]
.
.
</snip>
.
[javac] 100 errors

BUILD FAILED
Ben Litchfield
2004-10-06 00:44:00 UTC
Permalink
Have you changed the datatype in the gui? You can set either int or
java.lang.Integer.

Ben
Post by Terry W
Hi, I'm new to Middlegen and I'm real excited to use it.
I am taking an existing MySQL 4.0 database from an opensource project,
Coppermine, and I am running Middlegen against it to see how to use
Middlegen.
I am having a problem where an interface expects a wrapper class but
it is receiving a primitive variable.
I've seen messages posted about modifying the Sql2Java.java class and
messages about foreign keys of one class are accidentally named the
same as a key in another class of a different type, or there abouts.
I really haven't seen a definitive answer to this question other than
modifying the Sql2Java.java class or modifying a velocity template
file. By the way, which I don't see where in Middlegen 2.1 where I
would modify the primitive to wrapper classes in the velocity files.
If there are some other early adopter of Middlegen 2.1 who have also
seen the same problem please let me know what the workaround was.
-Terry
.
</snip>
.
.
[webdoclet] Generating web.xml.
[javac] Compiling 17 source files to
/home/terry/middlegen-2.1/samples/build/classes
findByVisibility(int) in airline.interfaces.Cpg131AlbumFacade cannot
be applied to (java.lang.Integer)
[javac]
retVals.addAll(airline.interfaces.Cpg131AlbumFacadeUtil.getHome().create().findByVisibility(cpg131AlbumForm.getVisibility()));
[javac]
.
.
</snip>
.
setParent(java.lang.Integer) in airline.web.struts.Cpg131CategoryForm
cannot be applied to (int)
[javac]
cpg131CategoryForm.setParent(cpg131CategoryPersistence.getParent());
[javac]
.
.
</snip>
.
[javac] 100 errors
BUILD FAILED
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Terry W
2004-10-06 12:58:30 UTC
Permalink
I will look into that. I see when I run ant with the gui [build]
button and a cmp2.0 frame below, the tables above with a gui select
drop down below, will choose only java wrapper classes for fields in
the database. I don't see any java primitives options in any of the
options in the drop down. I will keep trying.

btw, the airline.ear builds no problem.

I believe it is in the Struts build process that my type casting
problem exists.

it appears to be in the ..findByVisibility methods, and the TranslatorUtil class
-Terry
Post by Ben Litchfield
Have you changed the datatype in the gui? You can set either int or
java.lang.Integer.
Ben
Post by Terry W
Hi, I'm new to Middlegen and I'm real excited to use it.
I am taking an existing MySQL 4.0 database from an opensource project,
Coppermine, and I am running Middlegen against it to see how to use
Middlegen.
I am having a problem where an interface expects a wrapper class but
it is receiving a primitive variable.
I've seen messages posted about modifying the Sql2Java.java class and
messages about foreign keys of one class are accidentally named the
same as a key in another class of a different type, or there abouts.
I really haven't seen a definitive answer to this question other than
modifying the Sql2Java.java class or modifying a velocity template
file. By the way, which I don't see where in Middlegen 2.1 where I
would modify the primitive to wrapper classes in the velocity files.
If there are some other early adopter of Middlegen 2.1 who have also
seen the same problem please let me know what the workaround was.
-Terry
.
</snip>
.
.
[webdoclet] Generating web.xml.
[javac] Compiling 17 source files to
/home/terry/middlegen-2.1/samples/build/classes
findByVisibility(int) in airline.interfaces.Cpg131AlbumFacade cannot
be applied to (java.lang.Integer)
[javac]
retVals.addAll(airline.interfaces.Cpg131AlbumFacadeUtil.getHome().create().findByVisibility(cpg131AlbumForm.getVisibility()));
[javac]
.
.
</snip>
.
setParent(java.lang.Integer) in airline.web.struts.Cpg131CategoryForm
cannot be applied to (int)
[javac]
cpg131CategoryForm.setParent(cpg131CategoryPersistence.getParent());
[javac]
.
.
</snip>
.
[javac] 100 errors
BUILD FAILED
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Terry W
2004-10-06 13:25:14 UTC
Permalink
I found the drop down with the primitive values for cmp2.0
persistence. I will test it out now.
-Terry
Post by Terry W
I will look into that. I see when I run ant with the gui [build]
button and a cmp2.0 frame below, the tables above with a gui select
drop down below, will choose only java wrapper classes for fields in
the database. I don't see any java primitives options in any of the
options in the drop down. I will keep trying.
btw, the airline.ear builds no problem.
I believe it is in the Struts build process that my type casting
problem exists.
it appears to be in the ..findByVisibility methods, and the TranslatorUtil class
-Terry
Post by Ben Litchfield
Have you changed the datatype in the gui? You can set either int or
java.lang.Integer.
Ben
Post by Terry W
Hi, I'm new to Middlegen and I'm real excited to use it.
I am taking an existing MySQL 4.0 database from an opensource project,
Coppermine, and I am running Middlegen against it to see how to use
Middlegen.
I am having a problem where an interface expects a wrapper class but
it is receiving a primitive variable.
I've seen messages posted about modifying the Sql2Java.java class and
messages about foreign keys of one class are accidentally named the
same as a key in another class of a different type, or there abouts.
I really haven't seen a definitive answer to this question other than
modifying the Sql2Java.java class or modifying a velocity template
file. By the way, which I don't see where in Middlegen 2.1 where I
would modify the primitive to wrapper classes in the velocity files.
If there are some other early adopter of Middlegen 2.1 who have also
seen the same problem please let me know what the workaround was.
-Terry
.
</snip>
.
.
[webdoclet] Generating web.xml.
[javac] Compiling 17 source files to
/home/terry/middlegen-2.1/samples/build/classes
findByVisibility(int) in airline.interfaces.Cpg131AlbumFacade cannot
be applied to (java.lang.Integer)
[javac]
retVals.addAll(airline.interfaces.Cpg131AlbumFacadeUtil.getHome().create().findByVisibility(cpg131AlbumForm.getVisibility()));
[javac]
.
.
</snip>
.
setParent(java.lang.Integer) in airline.web.struts.Cpg131CategoryForm
cannot be applied to (int)
[javac]
cpg131CategoryForm.setParent(cpg131CategoryPersistence.getParent());
[javac]
.
.
</snip>
.
[javac] 100 errors
BUILD FAILED
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Terry W
2004-10-06 13:34:23 UTC
Permalink
I tested it out using primitive attributes for the primary keys but I
ran into another build problem during the build process for EJBs.

So, I'm returning back to getting the int and java.lang.Integer
incompatibilities issues. let me know if you can help me
troubleshoot.
-Terry

compile-ejb:
[javac] Compiling 234 source files to C:\Documents and
Settings\Yeod\Desktop\download\middlegen-2.1\samples\build\classes
[javac] C:\Documents and
Settings\Yeod\Desktop\download\middlegen-2.1\samples\build\gen-src\airline\ejb\Cpg132AlbumBean.java:480:
incompatible types
[javac] found : <nulltype>
[javac] required: int
[javac] return null;
[javac] ^
Post by Terry W
I found the drop down with the primitive values for cmp2.0
persistence. I will test it out now.
-Terry
Post by Terry W
I will look into that. I see when I run ant with the gui [build]
button and a cmp2.0 frame below, the tables above with a gui select
drop down below, will choose only java wrapper classes for fields in
the database. I don't see any java primitives options in any of the
options in the drop down. I will keep trying.
btw, the airline.ear builds no problem.
I believe it is in the Struts build process that my type casting
problem exists.
it appears to be in the ..findByVisibility methods, and the TranslatorUtil class
-Terry
Post by Ben Litchfield
Have you changed the datatype in the gui? You can set either int or
java.lang.Integer.
Ben
Post by Terry W
Hi, I'm new to Middlegen and I'm real excited to use it.
I am taking an existing MySQL 4.0 database from an opensource project,
Coppermine, and I am running Middlegen against it to see how to use
Middlegen.
I am having a problem where an interface expects a wrapper class but
it is receiving a primitive variable.
I've seen messages posted about modifying the Sql2Java.java class and
messages about foreign keys of one class are accidentally named the
same as a key in another class of a different type, or there abouts.
I really haven't seen a definitive answer to this question other than
modifying the Sql2Java.java class or modifying a velocity template
file. By the way, which I don't see where in Middlegen 2.1 where I
would modify the primitive to wrapper classes in the velocity files.
If there are some other early adopter of Middlegen 2.1 who have also
seen the same problem please let me know what the workaround was.
-Terry
.
</snip>
.
.
[webdoclet] Generating web.xml.
[javac] Compiling 17 source files to
/home/terry/middlegen-2.1/samples/build/classes
findByVisibility(int) in airline.interfaces.Cpg131AlbumFacade cannot
be applied to (java.lang.Integer)
[javac]
retVals.addAll(airline.interfaces.Cpg131AlbumFacadeUtil.getHome().create().findByVisibility(cpg131AlbumForm.getVisibility()));
[javac]
.
.
</snip>
.
setParent(java.lang.Integer) in airline.web.struts.Cpg131CategoryForm
cannot be applied to (int)
[javac]
cpg131CategoryForm.setParent(cpg131CategoryPersistence.getParent());
[javac]
.
.
</snip>
.
[javac] 100 errors
BUILD FAILED
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Terry W
2004-10-06 14:02:17 UTC
Permalink
I am getting more familiarized with middlegen. I think I am going to
take some time and make some more practice databases and run middlegen
against them.

so, this question is closed for now, until I will reinvestigate it later.

I am going to test the airline.ear file and see if it is compatible
with JBoss 4.0.

btw, I had a warning
WARNING (cmp20): JBoss 3.0 doesn't support fields that are part of CMR
to be CMP at the same time. You might want to set fkcmp="false" in the
cmp20 plugin.

has this issue been resolved with JBoss 4.0?
-Terry
Post by Terry W
I tested it out using primitive attributes for the primary keys but I
ran into another build problem during the build process for EJBs.
So, I'm returning back to getting the int and java.lang.Integer
incompatibilities issues. let me know if you can help me
troubleshoot.
-Terry
[javac] Compiling 234 source files to C:\Documents and
Settings\Yeod\Desktop\download\middlegen-2.1\samples\build\classes
[javac] C:\Documents and
incompatible types
[javac] found : <nulltype>
[javac] required: int
[javac] return null;
[javac] ^
Post by Terry W
I found the drop down with the primitive values for cmp2.0
persistence. I will test it out now.
-Terry
Post by Terry W
I will look into that. I see when I run ant with the gui [build]
button and a cmp2.0 frame below, the tables above with a gui select
drop down below, will choose only java wrapper classes for fields in
the database. I don't see any java primitives options in any of the
options in the drop down. I will keep trying.
btw, the airline.ear builds no problem.
I believe it is in the Struts build process that my type casting
problem exists.
it appears to be in the ..findByVisibility methods, and the TranslatorUtil class
-Terry
Post by Ben Litchfield
Have you changed the datatype in the gui? You can set either int or
java.lang.Integer.
Ben
Post by Terry W
Hi, I'm new to Middlegen and I'm real excited to use it.
I am taking an existing MySQL 4.0 database from an opensource project,
Coppermine, and I am running Middlegen against it to see how to use
Middlegen.
I am having a problem where an interface expects a wrapper class but
it is receiving a primitive variable.
I've seen messages posted about modifying the Sql2Java.java class and
messages about foreign keys of one class are accidentally named the
same as a key in another class of a different type, or there abouts.
I really haven't seen a definitive answer to this question other than
modifying the Sql2Java.java class or modifying a velocity template
file. By the way, which I don't see where in Middlegen 2.1 where I
would modify the primitive to wrapper classes in the velocity files.
If there are some other early adopter of Middlegen 2.1 who have also
seen the same problem please let me know what the workaround was.
-Terry
.
</snip>
.
.
[webdoclet] Generating web.xml.
[javac] Compiling 17 source files to
/home/terry/middlegen-2.1/samples/build/classes
findByVisibility(int) in airline.interfaces.Cpg131AlbumFacade cannot
be applied to (java.lang.Integer)
[javac]
retVals.addAll(airline.interfaces.Cpg131AlbumFacadeUtil.getHome().create().findByVisibility(cpg131AlbumForm.getVisibility()));
[javac]
.
.
</snip>
.
setParent(java.lang.Integer) in airline.web.struts.Cpg131CategoryForm
cannot be applied to (int)
[javac]
cpg131CategoryForm.setParent(cpg131CategoryPersistence.getParent());
[javac]
.
.
</snip>
.
[javac] 100 errors
BUILD FAILED
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Eivind Waaler
2004-10-06 14:15:35 UTC
Permalink
One point, instead of using the gui you can often just edit the
preferences file generated by Middlegen. In the sample this is located
under src/.

For instance replace all occurences of 'int' with 'Integer' or similar.
This is often much faster than using the gui..

.eivind
Post by Terry W
I am getting more familiarized with middlegen. I think I am going to
take some time and make some more practice databases and run middlegen
against them.
so, this question is closed for now, until I will reinvestigate it later.
I am going to test the airline.ear file and see if it is compatible
with JBoss 4.0.
btw, I had a warning
WARNING (cmp20): JBoss 3.0 doesn't support fields that are part of CMR
to be CMP at the same time. You might want to set fkcmp="false" in the
cmp20 plugin.
has this issue been resolved with JBoss 4.0?
-Terry
Post by Terry W
I tested it out using primitive attributes for the primary keys but I
ran into another build problem during the build process for EJBs.
So, I'm returning back to getting the int and java.lang.Integer
incompatibilities issues. let me know if you can help me
troubleshoot.
-Terry
[javac] Compiling 234 source files to C:\Documents and
Settings\Yeod\Desktop\download\middlegen-2.1\samples\build\classes
[javac] C:\Documents and
incompatible types
[javac] found : <nulltype>
[javac] required: int
[javac] return null;
[javac] ^
Post by Terry W
I found the drop down with the primitive values for cmp2.0
persistence. I will test it out now.
-Terry
Post by Terry W
I will look into that. I see when I run ant with the gui [build]
button and a cmp2.0 frame below, the tables above with a gui select
drop down below, will choose only java wrapper classes for fields in
the database. I don't see any java primitives options in any of the
options in the drop down. I will keep trying.
btw, the airline.ear builds no problem.
I believe it is in the Struts build process that my type casting
problem exists.
it appears to be in the ..findByVisibility methods, and the TranslatorUtil class
-Terry
Post by Ben Litchfield
Have you changed the datatype in the gui? You can set either int or
java.lang.Integer.
Ben
Post by Terry W
Hi, I'm new to Middlegen and I'm real excited to use it.
I am taking an existing MySQL 4.0 database from an opensource project,
Coppermine, and I am running Middlegen against it to see how to use
Middlegen.
I am having a problem where an interface expects a wrapper class but
it is receiving a primitive variable.
I've seen messages posted about modifying the Sql2Java.java class and
messages about foreign keys of one class are accidentally named the
same as a key in another class of a different type, or there abouts.
I really haven't seen a definitive answer to this question other than
modifying the Sql2Java.java class or modifying a velocity template
file. By the way, which I don't see where in Middlegen 2.1 where I
would modify the primitive to wrapper classes in the velocity files.
If there are some other early adopter of Middlegen 2.1 who have also
seen the same problem please let me know what the workaround was.
-Terry
.
</snip>
.
.
[webdoclet] Generating web.xml.
[javac] Compiling 17 source files to
/home/terry/middlegen-2.1/samples/build/classes
findByVisibility(int) in airline.interfaces.Cpg131AlbumFacade cannot
be applied to (java.lang.Integer)
[javac]
retVals.addAll(airline.interfaces.Cpg131AlbumFacadeUtil.getHome().create().findByVisibility(cpg131AlbumForm.getVisibility()));
[javac]
.
.
</snip>
.
setParent(java.lang.Integer) in airline.web.struts.Cpg131CategoryForm
cannot be applied to (int)
[javac]
cpg131CategoryForm.setParent(cpg131CategoryPersistence.getParent());
[javac]
.
.
</snip>
.
[javac] 100 errors
BUILD FAILED
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Terry W
2004-10-06 17:13:27 UTC
Permalink
I checked that out. The file
'\middlegen-2.1\samples\src\airline-prefs.properties'

lists all the primitives and wrapper classes there. However, I'm
experiencing that the airline-prefs.properties file is being
overwritten each time I run middlegen, with the ant command.

Is their a method to run middlegen without overwriting the
'airline-prefs.properties' each time?
-Terry


On Wed, 6 Oct 2004 18:13:31 +0200 (CEST), Eivind Waaler
Post by Eivind Waaler
One point, instead of using the gui you can often just edit the
preferences file generated by Middlegen. In the sample this is located
under src/.
For instance replace all occurences of 'int' with 'Integer' or similar.
This is often much faster than using the gui..
.eivind
Post by Terry W
I am getting more familiarized with middlegen. I think I am going to
take some time and make some more practice databases and run middlegen
against them.
so, this question is closed for now, until I will reinvestigate it later.
I am going to test the airline.ear file and see if it is compatible
with JBoss 4.0.
btw, I had a warning
WARNING (cmp20): JBoss 3.0 doesn't support fields that are part of CMR
to be CMP at the same time. You might want to set fkcmp="false" in the
cmp20 plugin.
has this issue been resolved with JBoss 4.0?
-Terry
Post by Terry W
I tested it out using primitive attributes for the primary keys but I
ran into another build problem during the build process for EJBs.
So, I'm returning back to getting the int and java.lang.Integer
incompatibilities issues. let me know if you can help me
troubleshoot.
-Terry
[javac] Compiling 234 source files to C:\Documents and
Settings\Yeod\Desktop\download\middlegen-2.1\samples\build\classes
[javac] C:\Documents and
incompatible types
[javac] found : <nulltype>
[javac] required: int
[javac] return null;
[javac] ^
Post by Terry W
I found the drop down with the primitive values for cmp2.0
persistence. I will test it out now.
-Terry
Post by Terry W
I will look into that. I see when I run ant with the gui [build]
button and a cmp2.0 frame below, the tables above with a gui select
drop down below, will choose only java wrapper classes for fields in
the database. I don't see any java primitives options in any of the
options in the drop down. I will keep trying.
btw, the airline.ear builds no problem.
I believe it is in the Struts build process that my type casting
problem exists.
it appears to be in the ..findByVisibility methods, and the TranslatorUtil class
-Terry
Post by Ben Litchfield
Have you changed the datatype in the gui? You can set either int or
java.lang.Integer.
Ben
Post by Terry W
Hi, I'm new to Middlegen and I'm real excited to use it.
I am taking an existing MySQL 4.0 database from an opensource project,
Coppermine, and I am running Middlegen against it to see how to use
Middlegen.
I am having a problem where an interface expects a wrapper class but
it is receiving a primitive variable.
I've seen messages posted about modifying the Sql2Java.java class and
messages about foreign keys of one class are accidentally named the
same as a key in another class of a different type, or there abouts.
I really haven't seen a definitive answer to this question other than
modifying the Sql2Java.java class or modifying a velocity template
file. By the way, which I don't see where in Middlegen 2.1 where I
would modify the primitive to wrapper classes in the velocity files.
If there are some other early adopter of Middlegen 2.1 who have also
seen the same problem please let me know what the workaround was.
-Terry
.
</snip>
.
.
[webdoclet] Generating web.xml.
[javac] Compiling 17 source files to
/home/terry/middlegen-2.1/samples/build/classes
findByVisibility(int) in airline.interfaces.Cpg131AlbumFacade cannot
be applied to (java.lang.Integer)
[javac]
retVals.addAll(airline.interfaces.Cpg131AlbumFacadeUtil.getHome().create().findByVisibility(cpg131AlbumForm.getVisibility()));
[javac]
.
.
</snip>
.
setParent(java.lang.Integer) in airline.web.struts.Cpg131CategoryForm
cannot be applied to (int)
[javac]
cpg131CategoryForm.setParent(cpg131CategoryPersistence.getParent());
[javac]
.
.
</snip>
.
[javac] 100 errors
BUILD FAILED
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Terry W
2004-10-06 17:16:18 UTC
Permalink
excuse me first and thank you, I was able to update the
'airline-prefs.properties' file without losing my changes.
-Terry
Post by Terry W
I checked that out. The file
'\middlegen-2.1\samples\src\airline-prefs.properties'
lists all the primitives and wrapper classes there. However, I'm
experiencing that the airline-prefs.properties file is being
overwritten each time I run middlegen, with the ant command.
Is their a method to run middlegen without overwriting the
'airline-prefs.properties' each time?
-Terry
On Wed, 6 Oct 2004 18:13:31 +0200 (CEST), Eivind Waaler
Post by Eivind Waaler
One point, instead of using the gui you can often just edit the
preferences file generated by Middlegen. In the sample this is located
under src/.
For instance replace all occurences of 'int' with 'Integer' or similar.
This is often much faster than using the gui..
.eivind
Post by Terry W
I am getting more familiarized with middlegen. I think I am going to
take some time and make some more practice databases and run middlegen
against them.
so, this question is closed for now, until I will reinvestigate it later.
I am going to test the airline.ear file and see if it is compatible
with JBoss 4.0.
btw, I had a warning
WARNING (cmp20): JBoss 3.0 doesn't support fields that are part of CMR
to be CMP at the same time. You might want to set fkcmp="false" in the
cmp20 plugin.
has this issue been resolved with JBoss 4.0?
-Terry
Post by Terry W
I tested it out using primitive attributes for the primary keys but I
ran into another build problem during the build process for EJBs.
So, I'm returning back to getting the int and java.lang.Integer
incompatibilities issues. let me know if you can help me
troubleshoot.
-Terry
[javac] Compiling 234 source files to C:\Documents and
Settings\Yeod\Desktop\download\middlegen-2.1\samples\build\classes
[javac] C:\Documents and
incompatible types
[javac] found : <nulltype>
[javac] required: int
[javac] return null;
[javac] ^
Post by Terry W
I found the drop down with the primitive values for cmp2.0
persistence. I will test it out now.
-Terry
Post by Terry W
I will look into that. I see when I run ant with the gui [build]
button and a cmp2.0 frame below, the tables above with a gui select
drop down below, will choose only java wrapper classes for fields in
the database. I don't see any java primitives options in any of the
options in the drop down. I will keep trying.
btw, the airline.ear builds no problem.
I believe it is in the Struts build process that my type casting
problem exists.
it appears to be in the ..findByVisibility methods, and the TranslatorUtil class
-Terry
Post by Ben Litchfield
Have you changed the datatype in the gui? You can set either int or
java.lang.Integer.
Ben
Post by Terry W
Hi, I'm new to Middlegen and I'm real excited to use it.
I am taking an existing MySQL 4.0 database from an opensource project,
Coppermine, and I am running Middlegen against it to see how to use
Middlegen.
I am having a problem where an interface expects a wrapper class but
it is receiving a primitive variable.
I've seen messages posted about modifying the Sql2Java.java class and
messages about foreign keys of one class are accidentally named the
same as a key in another class of a different type, or there abouts.
I really haven't seen a definitive answer to this question other than
modifying the Sql2Java.java class or modifying a velocity template
file. By the way, which I don't see where in Middlegen 2.1 where I
would modify the primitive to wrapper classes in the velocity files.
If there are some other early adopter of Middlegen 2.1 who have also
seen the same problem please let me know what the workaround was.
-Terry
.
</snip>
.
.
[webdoclet] Generating web.xml.
[javac] Compiling 17 source files to
/home/terry/middlegen-2.1/samples/build/classes
findByVisibility(int) in airline.interfaces.Cpg131AlbumFacade cannot
be applied to (java.lang.Integer)
[javac]
retVals.addAll(airline.interfaces.Cpg131AlbumFacadeUtil.getHome().create().findByVisibility(cpg131AlbumForm.getVisibility()));
[javac]
.
.
</snip>
.
setParent(java.lang.Integer) in airline.web.struts.Cpg131CategoryForm
cannot be applied to (int)
[javac]
cpg131CategoryForm.setParent(cpg131CategoryPersistence.getParent());
[javac]
.
.
</snip>
.
[javac] 100 errors
BUILD FAILED
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Darren Hartford
2004-10-07 15:02:45 UTC
Permalink
There is also a JavaTypeMapper class you may want to look into and extend to specify dbtype-to-java mappings.
-----Original Message-----
Sent: Wednesday, October 06, 2004 3:15 PM
Subject: Re: [Middlegen-user] Middlegen 2.1 and an int and
java.lang.Integer interface incompatibility
excuse me first and thank you, I was able to update the
'airline-prefs.properties' file without losing my changes.
-Terry
On Wed, 6 Oct 2004 15:12:12 -0400, Terry W
Post by Terry W
I checked that out. The file
'\middlegen-2.1\samples\src\airline-prefs.properties'
lists all the primitives and wrapper classes there. However, I'm
experiencing that the airline-prefs.properties file is being
overwritten each time I run middlegen, with the ant command.
Is their a method to run middlegen without overwriting the
'airline-prefs.properties' each time?
-Terry
On Wed, 6 Oct 2004 18:13:31 +0200 (CEST), Eivind Waaler
Post by Eivind Waaler
One point, instead of using the gui you can often just edit the
preferences file generated by Middlegen. In the sample
this is located
Post by Terry W
Post by Eivind Waaler
under src/.
For instance replace all occurences of 'int' with
'Integer' or similar.
Post by Terry W
Post by Eivind Waaler
This is often much faster than using the gui..
.eivind
Post by Terry W
I am getting more familiarized with middlegen. I think
I am going to
Post by Terry W
Post by Eivind Waaler
Post by Terry W
take some time and make some more practice databases
and run middlegen
Post by Terry W
Post by Eivind Waaler
Post by Terry W
against them.
so, this question is closed for now, until I will
reinvestigate it later.
Post by Terry W
Post by Eivind Waaler
Post by Terry W
I am going to test the airline.ear file and see if it
is compatible
Post by Terry W
Post by Eivind Waaler
Post by Terry W
with JBoss 4.0.
btw, I had a warning
WARNING (cmp20): JBoss 3.0 doesn't support fields that
are part of CMR
Post by Terry W
Post by Eivind Waaler
Post by Terry W
to be CMP at the same time. You might want to set
fkcmp="false" in the
Post by Terry W
Post by Eivind Waaler
Post by Terry W
cmp20 plugin.
has this issue been resolved with JBoss 4.0?
-Terry
On Wed, 6 Oct 2004 11:32:15 -0400, Terry W
Post by Terry W
I tested it out using primitive attributes for the
primary keys but I
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
ran into another build problem during the build
process for EJBs.
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
So, I'm returning back to getting the int and
java.lang.Integer
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
incompatibilities issues. let me know if you can help me
troubleshoot.
-Terry
[javac] Compiling 234 source files to C:\Documents and
Settings\Yeod\Desktop\download\middlegen-2.1\samples\build\classes
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
[javac] C:\Documents and
Settings\Yeod\Desktop\download\middlegen-2.1\samples\build\gen
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
incompatible types
[javac] found : <nulltype>
[javac] required: int
[javac] return null;
[javac] ^
On Wed, 6 Oct 2004 11:23:21 -0400, Terry W
Post by Terry W
I found the drop down with the primitive values for cmp2.0
persistence. I will test it out now.
-Terry
On Wed, 6 Oct 2004 10:56:50 -0400, Terry W
Post by Terry W
I will look into that. I see when I run ant with
the gui [build]
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
button and a cmp2.0 frame below, the tables above
with a gui select
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
drop down below, will choose only java wrapper
classes for fields in
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
the database. I don't see any java primitives
options in any of the
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
options in the drop down. I will keep trying.
btw, the airline.ear builds no problem.
I believe it is in the Struts build process that
my type casting
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
problem exists.
it appears to be in the ..findByVisibility
methods, and the TranslatorUtil class
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
-Terry
On Tue, 5 Oct 2004 22:42:38 -0400 (EDT), Ben
Post by Ben Litchfield
Have you changed the datatype in the gui? You
can set either int or
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
java.lang.Integer.
Ben
Post by Terry W
Hi, I'm new to Middlegen and I'm real excited
to use it.
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
I am taking an existing MySQL 4.0 database
from an opensource project,
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
Coppermine, and I am running Middlegen
against it to see how to use
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
Middlegen.
I am having a problem where an interface
expects a wrapper class but
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
it is receiving a primitive variable.
I've seen messages posted about modifying the
Sql2Java.java class and
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
messages about foreign keys of one class are
accidentally named the
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
same as a key in another class of a different
type, or there abouts.
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
I really haven't seen a definitive answer to
this question other than
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
modifying the Sql2Java.java class or
modifying a velocity template
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
file. By the way, which I don't see where in
Middlegen 2.1 where I
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
would modify the primitive to wrapper classes
in the velocity files.
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
If there are some other early adopter of
Middlegen 2.1 who have also
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
seen the same problem please let me know what
the workaround was.
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
-Terry
.
</snip>
.
.
[webdoclet] Generating web.xml.
[javac] Compiling 17 source files to
/home/terry/middlegen-2.1/samples/build/classes
[javac]
/home/terry/middlegen-2.1/samples/build/gen-src/airline/adapte
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
findByVisibility(int) in
airline.interfaces.Cpg131AlbumFacade cannot
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
be applied to (java.lang.Integer)
[javac]
retVals.addAll(airline.interfaces.Cpg131AlbumFacadeUtil.getHom
e().create().findByVisibility(cpg131AlbumForm.getVisibility()));
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
[javac]
.
.
</snip>
.
[javac]
/home/terry/middlegen-2.1/samples/build/gen-src/airline/adapte
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
setParent(java.lang.Integer) in
airline.web.struts.Cpg131CategoryForm
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
cannot be applied to (int)
[javac]
cpg131CategoryForm.setParent(cpg131CategoryPersistence.getParent());
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
[javac]
.
.
</snip>
.
[javac] 100 errors
BUILD FAILED
-------------------------------------------------------
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
This SF.net email is sponsored by: IT Product
Guide on ITManagersJournal
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
Use IT products in your business? Tell us
what you think of them. Give us
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
Your Opinions, Get Free ThinkGeek Gift
Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Post by Terry W
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
-------------------------------------------------------
This SF.net email is sponsored by: IT Product
Guide on ITManagersJournal
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Use IT products in your business? Tell us what
you think of them. Give us
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
Your Opinions, Get Free ThinkGeek Gift
Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Post by Terry W
Post by Terry W
Post by Terry W
Post by Ben Litchfield
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Post by Terry W
Post by Eivind Waaler
Post by Terry W
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on
ITManagersJournal
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Use IT products in your business? Tell us what you
think of them. Give us
Post by Terry W
Post by Eivind Waaler
Post by Terry W
Your Opinions, Get Free ThinkGeek Gift Certificates!
Click to find out more
Post by Terry W
Post by Eivind Waaler
Post by Terry W
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on
ITManagersJournal
Post by Terry W
Post by Eivind Waaler
Use IT products in your business? Tell us what you think
of them. Give us
Post by Terry W
Post by Eivind Waaler
Your Opinions, Get Free ThinkGeek Gift Certificates!
Click to find out more
Post by Terry W
Post by Eivind Waaler
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on
ITManagersJournal
Use IT products in your business? Tell us what you think of
them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to
find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Loading...