[hibernate-issues] [Hibernate-JIRA] Resolved: (ANN-749) Generated Annotation can not generate Date automatically

Diego Plentz (JIRA) noreply at atlassian.com
Thu Aug 14 16:40:06 EDT 2008


     [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-749?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Diego Plentz resolved ANN-749.
------------------------------

      Assignee: Diego Plentz
    Resolution: Rejected

yuanqingfei, use the forum for usage questions.

> Generated Annotation can not generate Date automatically
> --------------------------------------------------------
>
>                 Key: ANN-749
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-749
>             Project: Hibernate Annotations
>          Issue Type: Bug
>    Affects Versions: 3.3.1.GA, 3.4.0.CR1
>         Environment: OS: Windows XP
> DB: HSQL
>            Reporter: yuanqingfei
>            Assignee: Diego Plentz
>
> 	@Before
> 	public void setup() {
> 		order = new Order();
> 		// enter all required fields
> 		order.setName("order1");
> 		order = orderDAO.save(order); //Hibernate should generate a timestamp here
> 	}
> 	@Test
> 	public void testSave() {
> 		assertTrue(orderDAO.exists(order.getId()));
> 		System.out.println(order.getCreateTime()); //here should get a date.
> 	}
> Annotation part in Order:
> 	@Temporal(TemporalType.TIMESTAMP)
> 	@Column(insertable = false,updatable=false)
> 	@org.hibernate.annotations.Generated(org.hibernate.annotations.GenerationTime.INSERT)
> 	private Date createTime;
> Save part in OrderDAO.
> 	@SuppressWarnings("unchecked")
> 	public T save(T object) {
> 		return (T) super.getHibernateTemplate().merge(object);
> 	}
> every time, I just only get null.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list