From 1350cba2b77cbb752d85ef6512f100c084d118cc Mon Sep 17 00:00:00 2001 From: brmeyer Date: Tue, 9 Oct 2012 14:50:39 -0400 Subject: [PATCH] HHH-7655 @Temporal should not be required on Date/Calendar fields --- .../entity/TemporalBindingTest.java | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/TemporalBindingTest.java b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/TemporalBindingTest.java index 23b5e0ffc6..dfb8d9fd31 100644 --- a/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/TemporalBindingTest.java +++ b/hibernate-core/src/test/java/org/hibernate/metamodel/internal/source/annotations/entity/TemporalBindingTest.java @@ -23,45 +23,31 @@ */ package org.hibernate.metamodel.internal.source.annotations.entity; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + import java.util.Date; + import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import org.junit.Test; - -import org.hibernate.AnnotationException; import org.hibernate.metamodel.spi.binding.AttributeBinding; import org.hibernate.metamodel.spi.binding.EntityBinding; import org.hibernate.metamodel.spi.binding.HibernateTypeDescriptor; import org.hibernate.testing.junit4.BaseAnnotationBindingTestCase; import org.hibernate.testing.junit4.Resources; import org.hibernate.type.TimestampType; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import org.junit.Test; /** * @author Strong Liu */ public class TemporalBindingTest extends BaseAnnotationBindingTestCase { - @Entity - class Item1 { - @Id - long id; - Date date; - } - - @Test(expected = AnnotationException.class) - @Resources(annotatedClasses = TemporalBindingTest.Item1.class) - public void testNoTemporalAnnotationOnTemporalTypeAttribute() { - getEntityBinding( Item1.class ); - - } - - @Entity + + @Entity class Item2 { @Id long id;