JavaEOGenerator running, but I do not understand the output.
JavaEOGenerator running, but I do not understand the output.
- Subject: JavaEOGenerator running, but I do not understand the output.
- From: Johan Henselmans <email@hidden>
- Date: Sat, 10 Nov 2007 22:01:21 +0100
I downloaded the JavaEOGenerator-beta2.tar,.gz some time ago from http://webobjects.mdimension.com/wolips/EOGenerator/
and after a lot of testing I finally got it running.
First of all I generated a example.eogen file via WOLIps (running
3.3.1.1 with last nights WOLips)
That file would not run directly, so I created another one
example0.eogen and started tweaking.
The trick was:
1- replace the -model argument with the full path, and add file: in
front of it
eg: from [Example.eomodeld] to [file:/Users/johan/projects/example/
Resources/Example.eomodeld].
2- replace -destination path with the full path without the file: in
front of it.
eg: from [Sources] to [/Users/johan/projects/example/Sources]
3- replace -subclassDestination with the full path without the file:
in front of it.
eg: from [Sources] to [/Users/johan/projects/example/
Sources]
You have to remove the square brackets from the pathnames of course.
Here is an example, original (not working) and one that is working:
not working:
========
Applications/Developing/JavaEOGenerator.woa/JavaEOGenerator -
destination Sources -java -javaTemplate JavaSourceEOF52.eotemplate -
model Resources/Example.eomodeld -packagedirs -subclassDestination
Sources -subclassJavaTemplate JavaSubclassSourceEOF5.eotemplate -
templatedir /Applications/Developing/JavaEOGeneratorTemplates -verbose
========
working:
========
/Applications/Developing/JavaEOGenerator.woa/JavaEOGenerator -
destination /Users/johan/projecten/example/ExampleBL/Sources -java -
javaTemplate JavaSourceEOF52.eotemplate -model file:/Users/johan/
projecten/example/ExampleBL/Resources/Example.eomodeld -packagedirs -
subclassDestination /Users/johan/projecten/example/ExampleBL/Sources -
subclassJavaTemplate JavaSubclassSourceEOF5.eotemplate -templatedir /
Applications/Developing/JavaEOGeneratorTemplates -verbose
========
However now I am confronted with interesting output.
We take the class ProgramSetting as an example.
The old EOGenerator created [_ProgramSetting] and [ProgramSetting]
java files
The new JavaEOGenerator creates [base/_ProgramSetting] and
[.ProgramSetting] java files,
So now I have in the Sources folder:
_ProgramSetting.java
ProgramSetting.java
base/_ProgramSetting.java
.ProgramSetting.java
In the .ProgramSetting file there is no package described, however
there is an empty definition:
************
//
// ProgramSetting.java
//
// copyright
package ;
import com.webobjects.foundation.*;
import com.webobjects.eocontrol.*;
import com.webobjects.eoaccess.*;
import java.math.BigDecimal;
import java.util.*;
private static NSArray<ProgramSetting> _allObjects() {
return
(NSArray
)EOSharedEditingContext
.defaultSharedEditingContext
().objectsByEntityName().objectForKey("ProgramSetting");
}
public static NSArray<ProgramSetting> allObjects() {
if (_allObjects() != null) {
return _allObjects();
} else {
return NSArray.emptyArray();
}
}
public static NSArray<ProgramSetting> allObjects(EOEditingContext
aContext) {
return _ProgramSetting.objectsForFetchAll(aContext);
}
public void
awakeFromInsertion(com.webobjects.eocontrol.EOEditingContext
anEditingContext) {
super.awakeFromInsertion(anEditingContext);
// Set default value for the object after its creation
}
public void
awakeFromFetch(com.webobjects.eocontrol.EOEditingContext
anEditingContext) {
super.awakeFromFetch(anEditingContext);
// Set default value for the object after its fetch
}
}
**************
So these are my questions:
- What is the idea behind all this? (please no "42" answers)
- Why the base folder?
- Why the .class.java file?
- Should the class files should be in a package, and where is that
defined?
- What to do with the old java files? Merge them?
And finally:
- Are these generated files also usable in a 5.3 environment?
Regards,
Johan Henselmans
http://www.netsense.nl
Tel: +31-20-6267538
Fax: +31-20-6273852
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden