Just starting to learn about Jaxor, and like a birthday kid excited by his many new presents, I look at Jaxor's cool features. But, does it make sense to consider using the Domain logic (extend the Base class) and the Generation from db schema features together?
What I think this looks like is:
1. Set up database schema.
2. Some tables will be base objects that you will want to extend, let's say the FOOBAR table will become a Foobar object, so I write the Foobar class extending Jaxor's FoobarBase.
3. Run schema2jaxor + jaxor + javac -- I have hacked jaxor.vm template to add an <code>impl</code> attribute: <code><entity name="FOOBAR" impl="Foobar"></code>
Is this reasonable? Is there another way to accomplish this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Would it be easier to just use schema2jaxor once to generate the first set of jaxor mapping files, then modify the mapping files? I've found the task saves a lot of time initially, but once the first set of mappings are generated, I prefer to modify them myself to customize the entity. To ensure the mappings stay in sync, I use the ColumnChecker task that validates the mappings.
Regards,
Mike
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just starting to learn about Jaxor, and like a birthday kid excited by his many new presents, I look at Jaxor's cool features. But, does it make sense to consider using the Domain logic (extend the Base class) and the Generation from db schema features together?
What I think this looks like is:
1. Set up database schema.
2. Some tables will be base objects that you will want to extend, let's say the FOOBAR table will become a Foobar object, so I write the Foobar class extending Jaxor's FoobarBase.
3. Run schema2jaxor + jaxor + javac -- I have hacked jaxor.vm template to add an <code>impl</code> attribute: <code><entity name="FOOBAR" impl="Foobar"></code>
Is this reasonable? Is there another way to accomplish this?
> 2. Some tables will be base objects that you will want to extend
But hacking the jaxor.vm template means that ALL base objects need to be extended.
Second idea: extend AntTask to include nexted elements like this:
<extend base="FoobarBase" impl="Foobar">
Now ONLY the indicated classes get extended. The effect is the same as having an impl="Foobar" attribute in the foobar.jaxor file.
Add a new nested element seems like a good idea.
Would it be easier to just use schema2jaxor once to generate the first set of jaxor mapping files, then modify the mapping files? I've found the task saves a lot of time initially, but once the first set of mappings are generated, I prefer to modify them myself to customize the entity. To ensure the mappings stay in sync, I use the ColumnChecker task that validates the mappings.
Regards,
Mike
> Would it be easier ...
That sounds very sensible. I'll try that and see how it feels as I learn more about Jaxor's features.
Thanks!