You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by José Luis Cetina <ma...@gmail.com> on 2012/05/29 17:09:56 UTC

@Temporal

Why when i use the ReverseMappingTool from JPA the @Temporal annotation (
for Date columns) never add to my entity, i have to add the annotation
manually??

-- 
-------------------------------------------------------------------
*SCJA. José Luis Cetina*
-------------------------------------------------------------------

Re: AW: @Temporal

Posted by Jason Zwolak <jz...@gmail.com>.
I see.  I understand the reverse mapping tool is just a starting point.  I
implemented a ReverseCustomizer to help with some of the details for my
particular problem and I fixed a bug in OpenJPA.  Now I'm on to the next
which is how to best add Temporal annotations to 65 tables!

I was just noticing that Michael Spiro was getting the annotation and
wondering if there's something I can do to have the annotation generated,
too.  I have 65 tables I'm reverse mapping and that will take a long time
by hand to add all the Temporal annotations.

I have a ReverseCustomizer implementation I created, is it possible I can
set something up in there to cause OpenJPA to generate the annotation?

--
Jason Zwolak


On Thu, Nov 21, 2013 at 3:20 PM, José Luis Cetina <ma...@gmail.com>wrote:

> Like Kevin sayed:
>
> "Examine the generated class, metadata, and mapping information, and modify
> it as necessary. Remember that the reverse mapping tool only provides a
> starting point, and you are free to make whatever modifications you like to
> the code it generates. "
>
> Resume: You have to add it by yourself
>
>
> 2013/11/21 Jason Zwolak <jz...@gmail.com>
>
> > I also do not get the @Temporal annotation.
> >
> > I'm using Oracle and the column type is "DATE" on one column and
> > "TIMESTAMP(6)" on another.
> >
> >
> >
> > --
> > View this message in context:
> > http://openjpa.208410.n2.nabble.com/Temporal-tp7579480p7585636.html
> > Sent from the OpenJPA Users mailing list archive at Nabble.com.
> >
>
>
>
> --
> -------------------------------------------------------------------
> *SCJA. José Luis Cetina*
> -------------------------------------------------------------------
>

Re: AW: @Temporal

Posted by José Luis Cetina <ma...@gmail.com>.
Like Kevin sayed:

"Examine the generated class, metadata, and mapping information, and modify
it as necessary. Remember that the reverse mapping tool only provides a
starting point, and you are free to make whatever modifications you like to
the code it generates. "

Resume: You have to add it by yourself


2013/11/21 Jason Zwolak <jz...@gmail.com>

> I also do not get the @Temporal annotation.
>
> I'm using Oracle and the column type is "DATE" on one column and
> "TIMESTAMP(6)" on another.
>
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/Temporal-tp7579480p7585636.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>



-- 
-------------------------------------------------------------------
*SCJA. José Luis Cetina*
-------------------------------------------------------------------

Re: AW: @Temporal

Posted by Jason Zwolak <jz...@gmail.com>.
I also do not get the @Temporal annotation.

I'm using Oracle and the column type is "DATE" on one column and
"TIMESTAMP(6)" on another.



--
View this message in context: http://openjpa.208410.n2.nabble.com/Temporal-tp7579480p7585636.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

AW: @Temporal

Posted by Michael Spiro <m....@dcs-caesar.de>.
Hi,

as I used the reverse mapping tool, I did get this annotation automatically
generated without any special configuration set up. I used it with a MySQL
database and this annotation has been generated for all database columns
declared as DATE or TIMESTAMP.

Kind regards,
Michael Spiro


> -----Ursprüngliche Nachricht-----
> Von: José Luis Cetina [mailto:maxtorzito@gmail.com]
> Gesendet: Dienstag, 29. Mai 2012 17:10
> An: users@openjpa.apache.org
> Betreff: @Temporal
> 
> Why when i use the ReverseMappingTool from JPA the @Temporal annotation
> ( for Date columns) never add to my entity, i have to add the
> annotation manually??
> 
> --
> -------------------------------------------------------------------
> *SCJA. José Luis Cetina*
> -------------------------------------------------------------------


Re: @Temporal

Posted by Kevin Sutter <kw...@gmail.com>.
Hi,
Step 4 under the Reverse Mapping Tool section [1] states this:

"Examine the generated class, metadata, and mapping information, and modify
it as necessary. Remember that the reverse mapping tool only provides a
starting point, and you are free to make whatever modifications you like to
the code it generates. "

Reverse Mapping was never meant to be an end-all code generator.  There
will be several areas that will require tweaking to ensure your Entities
properly represent your database schema, especially in the area of
relationships.  Given all of that, it would seem that the insertion of the
@Temporal annotation would be a relatively easy code generation feature, if
you are interested in participating in the community [2].  You could start
by creating a JIRA feature [3] and attaching a junit testcase to
demonstrate the issue.  The next step would be to experiment with the code
and come up with a patch as a proposed solution.  Good luck!

[1]
http://openjpa.apache.org/builds/latest/docs/docbook/manual.html#ref_guide_pc_reverse
[2]  http://openjpa.apache.org/get-involved.html
[3]  http://openjpa.apache.org/found-a-bug.html


On Tue, May 29, 2012 at 10:09 AM, José Luis Cetina <ma...@gmail.com>wrote:

> Why when i use the ReverseMappingTool from JPA the @Temporal annotation (
> for Date columns) never add to my entity, i have to add the annotation
> manually??
>
> --
> -------------------------------------------------------------------
> *SCJA. José Luis Cetina*
> -------------------------------------------------------------------
>