Search in sources :

Example 6 with ElementCollection

use of jakarta.persistence.ElementCollection in project hibernate-orm by hibernate.

the class Ejb3XmlElementCollectionTest method testAllAttributes.

@Test
public void testAllAttributes() throws Exception {
    reader = getReader(Entity2.class, "field1", "element-collection.orm28.xml");
    assertAnnotationPresent(ElementCollection.class);
    assertAnnotationNotPresent(OrderBy.class);
    assertAnnotationNotPresent(OrderColumn.class);
    assertAnnotationNotPresent(MapKey.class);
    assertAnnotationNotPresent(MapKeyClass.class);
    assertAnnotationNotPresent(MapKeyTemporal.class);
    assertAnnotationNotPresent(MapKeyEnumerated.class);
    assertAnnotationNotPresent(MapKeyColumn.class);
    assertAnnotationNotPresent(MapKeyJoinColumns.class);
    assertAnnotationNotPresent(MapKeyJoinColumn.class);
    assertAnnotationNotPresent(Column.class);
    assertAnnotationNotPresent(Temporal.class);
    assertAnnotationNotPresent(Enumerated.class);
    assertAnnotationNotPresent(Lob.class);
    assertAnnotationNotPresent(AttributeOverride.class);
    assertAnnotationNotPresent(AttributeOverrides.class);
    assertAnnotationNotPresent(AssociationOverride.class);
    assertAnnotationNotPresent(AssociationOverrides.class);
    assertAnnotationNotPresent(CollectionTable.class);
    assertAnnotationPresent(Access.class);
    ElementCollection relAnno = reader.getAnnotation(ElementCollection.class);
    assertEquals(FetchType.EAGER, relAnno.fetch());
    assertEquals(Entity3.class, relAnno.targetClass());
    assertEquals(AccessType.PROPERTY, reader.getAnnotation(Access.class).value());
}
Also used : ElementCollection(jakarta.persistence.ElementCollection) Test(org.junit.Test)

Aggregations

ElementCollection (jakarta.persistence.ElementCollection)6 ManyToMany (jakarta.persistence.ManyToMany)3 OneToMany (jakarta.persistence.OneToMany)3 ManyToAny (org.hibernate.annotations.ManyToAny)2 XClass (org.hibernate.annotations.common.reflection.XClass)2 Embedded (jakarta.persistence.Embedded)1 Enumerated (jakarta.persistence.Enumerated)1 FetchType (jakarta.persistence.FetchType)1 IdClass (jakarta.persistence.IdClass)1 JoinColumn (jakarta.persistence.JoinColumn)1 JoinColumns (jakarta.persistence.JoinColumns)1 ManyToOne (jakarta.persistence.ManyToOne)1 MapKey (jakarta.persistence.MapKey)1 MapKeyEnumerated (jakarta.persistence.MapKeyEnumerated)1 MapKeyJoinColumn (jakarta.persistence.MapKeyJoinColumn)1 MapKeyJoinColumns (jakarta.persistence.MapKeyJoinColumns)1 MapKeyTemporal (jakarta.persistence.MapKeyTemporal)1 OneToOne (jakarta.persistence.OneToOne)1 OrderColumn (jakarta.persistence.OrderColumn)1 PrimaryKeyJoinColumn (jakarta.persistence.PrimaryKeyJoinColumn)1