Comments inline.
James McGill wrote:
On Wed, 8 Oct 2003, Keith Visco wrote:
Well...you could use them together if you wanted to. Mappings take precedence over generated descriptors..so if you wanted to change behavior, you could write a mapping.
I posted a question a few days ago and got no reply, so maybe this is the appropriate time to ask again.
Can you control the behavior of the source generator to direct specific things to happen in the generated java files?
In a general sense, yes -- the sg binding file provides some options for affecting output. However ...
What I wish I could do is, make an XSD document to describe my model,
and run the generator to create castor binding classes (so far so
good.) What I also want to do, is somehow direct specific XDoclet tags to be placed in these files, at the class and method level. But
<annotation> does not do what I want. It comes close, but not quite what I need.
Specifically, I want to put the doclet tags needed for Hibernate
mapping into my generated Castor files. More generally, I would like to direct the generator to make specific formatting and commenting
decisions on the source it generates.
... this is not possible. I brought this up a while ago:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg13984.html
But then I found an alternate solution to my particular problem and stopped pursuing it.
Having seen what the generator does with xdoclet tags in <annotations>, I gave up and went back to writing hibernate hbm.xml files for each generated class.
Have you considered using XSLT to transform your schema into a single hbm.xml file for all your classes? Depending on how complex the schema is (that is, how many features you use), this could be easy or very, very hard. If you decide to go this route, I can provide you with a callable template that converts an [element|attribute|complexType] name into a [property|class] name the same way source generator does.
If you are doing this a lot (lots of schema changes, I mean), it might be worth your time to examine the proposal in the above thread. It might work for you, or it might give you an idea for a better solution. In any case, if implement a solution to this problem, I'm sure others would find it useful.
Rhett Sutphin
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
