HHH-7655 @Temporal should not be required on Date/Calendar fields
This commit is contained in:
parent
1017d94196
commit
1350cba2b7
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue