Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] how to generate history table under the history policy

Thanks for your reply, now I have another question. I use QueryHints. AS_OF to make a historical query.

 When I pass the date as hint parameter,  and look at the sql under console, the date parameter always is 1970-01-01. Do you have any suggestion?

 

Here is the code:

 

TypedQuery<Consignee> query=em.createQuery("select c from Consignee c where c.id=?1", Consignee.class);

                                query.setParameter(1, consignee.getId());

                                SimpleDateFormat format=new SimpleDateFormat("yyyy/MM/dd HH:mm:ss.S");

                                System.out.println(format.format(d));

                                query.setHint(QueryHints.AS_OF, format.format(d));

                                query.setHint(QueryHints.MAINTAIN_CACHE, false);

 

 

And for your hint, about the Session customer, I didn't find a method to get the default Table creator,  only table creator has the table definition.  Could you give more detailed description?

 

Regards,

Joe

 

 

-----Original Message-----
From: eclipselink-users-bounces@xxxxxxxxxxx [mailto:eclipselink-users-bounces@xxxxxxxxxxx] On Behalf Of José Arcángel Salazar Delgado
Sent: Tuesday, October 26, 2010 12:27 AM
To: EclipseLink User Discussions
Subject: Re: [eclipselink-users] how to generate history table under the history policy

 

On Lun 25 Oct 2010 01:46:12 Joe(Zhou Xiangtao) escribió:

> Hi everyone,

>

>

>

> What I need is automatically generate history table, there is no

> obvious method to achieve this.

Eclipselink doesn't have any method to automatic created the history table.

You need to manually create every table using some Session customizer.

>

>

>

> About the JPA history, you can find it here:

> http://wiki.eclipse.org/EclipseLink/Examples/JPA/History

>

>

>

> And about table generation, there is an old mail described it, but

> it's not clear, anyone can give a further description or demo code?

>

>

>

> http://dev.eclipse.org/mhonarc/lists/eclipselink-users/msg05160.html

>

>

>

> regards,

>

> Joe

_______________________________________________

eclipselink-users mailing list

eclipselink-users@xxxxxxxxxxx

https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top