Search in sources :

Example 1 with OrderColumn

use of javax.persistence.OrderColumn in project hibernate-orm by hibernate.

the class Ejb3XmlElementCollectionTest method testOrderColumnNoAttributes.

@Test
public void testOrderColumnNoAttributes() throws Exception {
    reader = getReader(Entity2.class, "field1", "element-collection.orm3.xml");
    assertAnnotationPresent(ElementCollection.class);
    assertAnnotationNotPresent(OrderBy.class);
    assertAnnotationPresent(OrderColumn.class);
    OrderColumn orderColumnAnno = reader.getAnnotation(OrderColumn.class);
    assertEquals("", orderColumnAnno.columnDefinition());
    assertEquals("", orderColumnAnno.name());
    assertTrue(orderColumnAnno.insertable());
    assertTrue(orderColumnAnno.nullable());
    assertTrue(orderColumnAnno.updatable());
}
Also used : OrderColumn(javax.persistence.OrderColumn) Test(org.junit.Test)

Example 2 with OrderColumn

use of javax.persistence.OrderColumn in project hibernate-orm by hibernate.

the class Ejb3XmlManyToManyTest method testOrderColumnAllAttributes.

@Test
public void testOrderColumnAllAttributes() throws Exception {
    reader = getReader(Entity2.class, "field1", "many-to-many.orm4.xml");
    assertAnnotationPresent(ManyToMany.class);
    assertAnnotationNotPresent(OrderBy.class);
    assertAnnotationPresent(OrderColumn.class);
    OrderColumn orderColumnAnno = reader.getAnnotation(OrderColumn.class);
    assertEquals("int", orderColumnAnno.columnDefinition());
    assertEquals("col1", orderColumnAnno.name());
    assertFalse(orderColumnAnno.insertable());
    assertFalse(orderColumnAnno.nullable());
    assertFalse(orderColumnAnno.updatable());
}
Also used : OrderColumn(javax.persistence.OrderColumn) Test(org.junit.Test)

Example 3 with OrderColumn

use of javax.persistence.OrderColumn in project hibernate-orm by hibernate.

the class Ejb3XmlElementCollectionTest method testOrderColumnAllAttributes.

@Test
public void testOrderColumnAllAttributes() throws Exception {
    reader = getReader(Entity2.class, "field1", "element-collection.orm4.xml");
    assertAnnotationPresent(ElementCollection.class);
    assertAnnotationNotPresent(OrderBy.class);
    assertAnnotationPresent(OrderColumn.class);
    OrderColumn orderColumnAnno = reader.getAnnotation(OrderColumn.class);
    assertEquals("int", orderColumnAnno.columnDefinition());
    assertEquals("col1", orderColumnAnno.name());
    assertFalse(orderColumnAnno.insertable());
    assertFalse(orderColumnAnno.nullable());
    assertFalse(orderColumnAnno.updatable());
}
Also used : OrderColumn(javax.persistence.OrderColumn) Test(org.junit.Test)

Example 4 with OrderColumn

use of javax.persistence.OrderColumn in project hibernate-orm by hibernate.

the class Ejb3XmlManyToManyTest method testOrderColumnNoAttributes.

@Test
public void testOrderColumnNoAttributes() throws Exception {
    reader = getReader(Entity2.class, "field1", "many-to-many.orm3.xml");
    assertAnnotationPresent(ManyToMany.class);
    assertAnnotationNotPresent(OrderBy.class);
    assertAnnotationPresent(OrderColumn.class);
    OrderColumn orderColumnAnno = reader.getAnnotation(OrderColumn.class);
    assertEquals("", orderColumnAnno.columnDefinition());
    assertEquals("", orderColumnAnno.name());
    assertTrue(orderColumnAnno.insertable());
    assertTrue(orderColumnAnno.nullable());
    assertTrue(orderColumnAnno.updatable());
}
Also used : OrderColumn(javax.persistence.OrderColumn) Test(org.junit.Test)

Example 5 with OrderColumn

use of javax.persistence.OrderColumn in project hibernate-orm by hibernate.

the class Ejb3XmlOneToManyTest method testOrderColumnNoAttributes.

@Test
public void testOrderColumnNoAttributes() throws Exception {
    reader = getReader(Entity2.class, "field1", "one-to-many.orm3.xml");
    assertAnnotationPresent(OneToMany.class);
    assertAnnotationNotPresent(OrderBy.class);
    assertAnnotationPresent(OrderColumn.class);
    OrderColumn orderColumnAnno = reader.getAnnotation(OrderColumn.class);
    assertEquals("", orderColumnAnno.columnDefinition());
    assertEquals("", orderColumnAnno.name());
    assertTrue(orderColumnAnno.insertable());
    assertTrue(orderColumnAnno.nullable());
    assertTrue(orderColumnAnno.updatable());
}
Also used : OrderColumn(javax.persistence.OrderColumn) Test(org.junit.Test)

Aggregations

OrderColumn (javax.persistence.OrderColumn)7 Test (org.junit.Test)7 ArrayList (java.util.ArrayList)1 List (java.util.List)1 JoinColumn (javax.persistence.JoinColumn)1 Metadata (org.hibernate.boot.Metadata)1 MetadataSources (org.hibernate.boot.MetadataSources)1 Collection (org.hibernate.mapping.Collection)1 Column (org.hibernate.mapping.Column)1 SchemaCreatorImpl (org.hibernate.tool.schema.internal.SchemaCreatorImpl)1 GenerationTargetToStdout (org.hibernate.tool.schema.internal.exec.GenerationTargetToStdout)1