HHH-10947 Add @Repeatable to Hibernate-owned annotations

This commit is contained in:
Brett Meyer 2016-07-11 15:33:35 -04:00
parent 825ab02723
commit da4f5e1a57
59 changed files with 325 additions and 385 deletions

View File

@ -40,7 +40,6 @@ import org.hibernate.userguide.model.PhoneType;
import org.hibernate.userguide.model.WireTransferPayment; import org.hibernate.userguide.model.WireTransferPayment;
import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.RequiresDialects;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
@ -1248,7 +1247,9 @@ public class HQLTest extends BaseEntityManagerFunctionalTestCase {
} }
@Test @Test
@RequiresDialects({@RequiresDialect(H2Dialect.class), @RequiresDialect(Oracle8iDialect.class), @RequiresDialect(MySQL5Dialect.class)}) @RequiresDialect(H2Dialect.class)
@RequiresDialect(Oracle8iDialect.class)
@RequiresDialect(MySQL5Dialect.class)
public void test_hql_bit_length_function_example() { public void test_hql_bit_length_function_example() {
doInJPA( this::entityManagerFactory, entityManager -> { doInJPA( this::entityManagerFactory, entityManager -> {
//tag::hql-bit-length-function-example[] //tag::hql-bit-length-function-example[]
@ -1743,7 +1744,9 @@ public class HQLTest extends BaseEntityManagerFunctionalTestCase {
} }
@Test @Test
@RequiresDialects({@RequiresDialect(H2Dialect.class), @RequiresDialect(PostgreSQL81Dialect.class), @RequiresDialect(MySQL5Dialect.class)}) @RequiresDialect(H2Dialect.class)
@RequiresDialect(PostgreSQL81Dialect.class)
@RequiresDialect(MySQL5Dialect.class)
public void test_hql_relational_comparisons_example_3() { public void test_hql_relational_comparisons_example_3() {
doInJPA( this::entityManagerFactory, entityManager -> { doInJPA( this::entityManagerFactory, entityManager -> {
@ -1946,7 +1949,9 @@ public class HQLTest extends BaseEntityManagerFunctionalTestCase {
} }
@Test @Test
@RequiresDialects({@RequiresDialect(H2Dialect.class), @RequiresDialect(PostgreSQL81Dialect.class), @RequiresDialect(MySQL5Dialect.class)}) @RequiresDialect(H2Dialect.class)
@RequiresDialect(PostgreSQL81Dialect.class)
@RequiresDialect(MySQL5Dialect.class)
public void test_hql_between_predicate_example_2() { public void test_hql_between_predicate_example_2() {
doInJPA( this::entityManagerFactory, entityManager -> { doInJPA( this::entityManagerFactory, entityManager -> {
@ -2200,7 +2205,9 @@ public class HQLTest extends BaseEntityManagerFunctionalTestCase {
} }
@Test @Test
@RequiresDialects({@RequiresDialect(H2Dialect.class), @RequiresDialect(PostgreSQL81Dialect.class), @RequiresDialect(MySQL5Dialect.class)}) @RequiresDialect(H2Dialect.class)
@RequiresDialect(PostgreSQL81Dialect.class)
@RequiresDialect(MySQL5Dialect.class)
public void test_hql_group_by_example_3() { public void test_hql_group_by_example_3() {
doInJPA( this::entityManagerFactory, entityManager -> { doInJPA( this::entityManagerFactory, entityManager -> {
@ -2220,7 +2227,9 @@ public class HQLTest extends BaseEntityManagerFunctionalTestCase {
} }
@Test @Test
@RequiresDialects({@RequiresDialect(H2Dialect.class), @RequiresDialect(PostgreSQL81Dialect.class), @RequiresDialect(MySQL5Dialect.class)}) @RequiresDialect(H2Dialect.class)
@RequiresDialect(PostgreSQL81Dialect.class)
@RequiresDialect(MySQL5Dialect.class)
public void test_hql_group_by_example_4() { public void test_hql_group_by_example_4() {
doInJPA( this::entityManagerFactory, entityManager -> { doInJPA( this::entityManagerFactory, entityManager -> {

View File

@ -7,18 +7,15 @@
// $Id$ // $Id$
//tag::mapping-column-any-meta-def-example[] //tag::mapping-column-any-meta-def-example[]
@AnyMetaDefs(
@AnyMetaDef( name= "PropertyMetaDef", metaType = "string", idType = "long", @AnyMetaDef( name= "PropertyMetaDef", metaType = "string", idType = "long",
metaValues = { metaValues = {
@MetaValue(value = "S", targetEntity = StringProperty.class), @MetaValue(value = "S", targetEntity = StringProperty.class),
@MetaValue(value = "I", targetEntity = IntegerProperty.class) @MetaValue(value = "I", targetEntity = IntegerProperty.class)
} }
) )
)
package org.hibernate.userguide.mapping.basic.any; package org.hibernate.userguide.mapping.basic.any;
import org.hibernate.annotations.AnyMetaDef; import org.hibernate.annotations.AnyMetaDef;
import org.hibernate.annotations.AnyMetaDefs;
import org.hibernate.annotations.MetaValue; import org.hibernate.annotations.MetaValue;
//end::mapping-column-any-meta-def-example[] //end::mapping-column-any-meta-def-example[]

View File

@ -29,7 +29,6 @@ import org.hibernate.dialect.PostgreSQL82Dialect;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase; import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.RequiresDialects;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
@ -44,7 +43,8 @@ import static org.junit.Assert.assertEquals;
* *
* @author Vlad Mihalcea * @author Vlad Mihalcea
*/ */
@RequiresDialects(value = {@RequiresDialect(H2Dialect.class), @RequiresDialect(PostgreSQL82Dialect.class)}) @RequiresDialect(H2Dialect.class)
@RequiresDialect(PostgreSQL82Dialect.class)
public class CollectionLoaderTest extends BaseEntityManagerFunctionalTestCase { public class CollectionLoaderTest extends BaseEntityManagerFunctionalTestCase {
private static final Logger log = Logger.getLogger( CollectionLoaderTest.class ); private static final Logger log = Logger.getLogger( CollectionLoaderTest.class );

View File

@ -27,7 +27,6 @@ import org.hibernate.dialect.PostgreSQL82Dialect;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase; import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.RequiresDialects;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
@ -40,7 +39,8 @@ import static org.junit.Assert.assertNull;
/** /**
* @author Vlad Mihalcea * @author Vlad Mihalcea
*/ */
@RequiresDialects(value = {@RequiresDialect(H2Dialect.class), @RequiresDialect(PostgreSQL82Dialect.class)}) @RequiresDialect(H2Dialect.class)
@RequiresDialect(PostgreSQL82Dialect.class)
public class CustomSQLSecondaryTableTest extends BaseEntityManagerFunctionalTestCase { public class CustomSQLSecondaryTableTest extends BaseEntityManagerFunctionalTestCase {
private static final Logger log = Logger.getLogger( CustomSQLSecondaryTableTest.class ); private static final Logger log = Logger.getLogger( CustomSQLSecondaryTableTest.class );

View File

@ -29,7 +29,6 @@ import org.hibernate.dialect.PostgreSQL82Dialect;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase; import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.RequiresDialects;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
@ -42,7 +41,8 @@ import static org.junit.Assert.assertNull;
/** /**
* @author Vlad Mihalcea * @author Vlad Mihalcea
*/ */
@RequiresDialects(value = {@RequiresDialect(H2Dialect.class), @RequiresDialect(PostgreSQL82Dialect.class)}) @RequiresDialect(H2Dialect.class)
@RequiresDialect(PostgreSQL82Dialect.class)
public class CustomSQLTest extends BaseEntityManagerFunctionalTestCase { public class CustomSQLTest extends BaseEntityManagerFunctionalTestCase {
private static final Logger log = Logger.getLogger( CustomSQLTest.class ); private static final Logger log = Logger.getLogger( CustomSQLTest.class );

View File

@ -34,7 +34,6 @@ import org.hibernate.userguide.model.PhoneType;
import org.hibernate.userguide.model.WireTransferPayment; import org.hibernate.userguide.model.WireTransferPayment;
import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.RequiresDialects;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
@ -397,7 +396,9 @@ public class SQLTest extends BaseEntityManagerFunctionalTestCase {
} }
@Test @Test
@RequiresDialects({@RequiresDialect(H2Dialect.class), @RequiresDialect(Oracle8iDialect.class), @RequiresDialect(PostgreSQL82Dialect.class)}) @RequiresDialect(H2Dialect.class)
@RequiresDialect(Oracle8iDialect.class)
@RequiresDialect(PostgreSQL82Dialect.class)
public void test_sql_jpa_entity_associations_query_one_to_many_join_example() { public void test_sql_jpa_entity_associations_query_one_to_many_join_example() {
doInJPA( this::entityManagerFactory, entityManager -> { doInJPA( this::entityManagerFactory, entityManager -> {
//tag::sql-jpa-entity-associations-query-one-to-many-join-example[] //tag::sql-jpa-entity-associations-query-one-to-many-join-example[]
@ -442,7 +443,9 @@ public class SQLTest extends BaseEntityManagerFunctionalTestCase {
} }
@Test @Test
@RequiresDialects({@RequiresDialect(H2Dialect.class), @RequiresDialect(Oracle8iDialect.class), @RequiresDialect(PostgreSQL82Dialect.class)}) @RequiresDialect(H2Dialect.class)
@RequiresDialect(Oracle8iDialect.class)
@RequiresDialect(PostgreSQL82Dialect.class)
public void test_sql_hibernate_entity_associations_query_one_to_many_join_example_2() { public void test_sql_hibernate_entity_associations_query_one_to_many_join_example_2() {
doInJPA( this::entityManagerFactory, entityManager -> { doInJPA( this::entityManagerFactory, entityManager -> {
Session session = entityManager.unwrap( Session.class ); Session session = entityManager.unwrap( Session.class );
@ -701,7 +704,9 @@ public class SQLTest extends BaseEntityManagerFunctionalTestCase {
} }
@Test @Test
@RequiresDialects({@RequiresDialect(H2Dialect.class), @RequiresDialect(Oracle8iDialect.class), @RequiresDialect(PostgreSQL82Dialect.class)}) @RequiresDialect(H2Dialect.class)
@RequiresDialect(Oracle8iDialect.class)
@RequiresDialect(PostgreSQL82Dialect.class)
public void test_sql_jpa_entity_associations_named_query_example() { public void test_sql_jpa_entity_associations_named_query_example() {
doInJPA( this::entityManagerFactory, entityManager -> { doInJPA( this::entityManagerFactory, entityManager -> {
//tag::sql-jpa-entity-associations_named-query-example[] //tag::sql-jpa-entity-associations_named-query-example[]
@ -720,7 +725,9 @@ public class SQLTest extends BaseEntityManagerFunctionalTestCase {
} }
@Test @Test
@RequiresDialects({@RequiresDialect(H2Dialect.class), @RequiresDialect(Oracle8iDialect.class), @RequiresDialect(PostgreSQL82Dialect.class)}) @RequiresDialect(H2Dialect.class)
@RequiresDialect(Oracle8iDialect.class)
@RequiresDialect(PostgreSQL82Dialect.class)
public void test_sql_hibernate_entity_associations_named_query_example() { public void test_sql_hibernate_entity_associations_named_query_example() {
doInJPA( this::entityManagerFactory, entityManager -> { doInJPA( this::entityManagerFactory, entityManager -> {
Session session = entityManager.unwrap( Session.class ); Session session = entityManager.unwrap( Session.class );

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.annotations; package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.FIELD;
@ -24,6 +25,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/ */
@java.lang.annotation.Target( { PACKAGE, TYPE, METHOD, FIELD } ) @java.lang.annotation.Target( { PACKAGE, TYPE, METHOD, FIELD } )
@Retention( RUNTIME ) @Retention( RUNTIME )
@Repeatable(AnyMetaDefs.class)
public @interface AnyMetaDef { public @interface AnyMetaDef {
/** /**
* If defined, assign a global meta definition name to be used in an @Any or @ManyToAny annotation. If * If defined, assign a global meta definition name to be used in an @Any or @ManyToAny annotation. If

View File

@ -5,6 +5,7 @@
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/ */
package org.hibernate.annotations; package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.FIELD;
@ -24,6 +25,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/ */
@java.lang.annotation.Target({FIELD,METHOD}) @java.lang.annotation.Target({FIELD,METHOD})
@Retention(RUNTIME) @Retention(RUNTIME)
@Repeatable(ColumnTransformers.class)
public @interface ColumnTransformer { public @interface ColumnTransformer {
/** /**
* (Logical) column name for which the expression is used. * (Logical) column name for which the expression is used.

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.annotations; package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@ -20,6 +21,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/ */
@Target({ TYPE, PACKAGE }) @Target({ TYPE, PACKAGE })
@Retention(RUNTIME) @Retention(RUNTIME)
@Repeatable(FetchProfiles.class)
public @interface FetchProfile { public @interface FetchProfile {
/** /**
* The name of the fetch profile. * The name of the fetch profile.

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.annotations; package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@ -24,6 +25,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/ */
@Target({TYPE, METHOD, FIELD}) @Target({TYPE, METHOD, FIELD})
@Retention(RUNTIME) @Retention(RUNTIME)
@Repeatable(Filters.class)
public @interface Filter { public @interface Filter {
/** /**
* The filter name. * The filter name.

View File

@ -5,6 +5,7 @@
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/ */
package org.hibernate.annotations; package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@ -20,6 +21,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/ */
@Target({TYPE, PACKAGE}) @Target({TYPE, PACKAGE})
@Retention(RUNTIME) @Retention(RUNTIME)
@Repeatable(FilterDefs.class)
public @interface FilterDef { public @interface FilterDef {
/** /**
* The filter name. * The filter name.

View File

@ -7,6 +7,7 @@
package org.hibernate.annotations; package org.hibernate.annotations;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@ -19,6 +20,7 @@ import java.lang.annotation.Target;
*/ */
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD}) @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Repeatable(FilterJoinTables.class)
public @interface FilterJoinTable { public @interface FilterJoinTable {
/** /**
* The filter name. * The filter name.

View File

@ -5,6 +5,7 @@
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/ */
package org.hibernate.annotations; package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@ -21,6 +22,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/ */
@Target({PACKAGE, TYPE, METHOD, FIELD}) @Target({PACKAGE, TYPE, METHOD, FIELD})
@Retention(RUNTIME) @Retention(RUNTIME)
@Repeatable(GenericGenerators.class)
public @interface GenericGenerator { public @interface GenericGenerator {
/** /**
* unique generator name. * unique generator name.

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.annotations; package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
@ -22,6 +23,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/ */
@Target({METHOD, FIELD}) @Target({METHOD, FIELD})
@Retention(RUNTIME) @Retention(RUNTIME)
@Repeatable(JoinColumnsOrFormulas.class)
public @interface JoinColumnOrFormula { public @interface JoinColumnOrFormula {
/** /**
* The formula to use in joining. * The formula to use in joining.

View File

@ -5,6 +5,8 @@
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/ */
package org.hibernate.annotations; package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@ -21,6 +23,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/ */
@Target({TYPE, PACKAGE}) @Target({TYPE, PACKAGE})
@Retention(RUNTIME) @Retention(RUNTIME)
@Repeatable(NamedNativeQueries.class)
public @interface NamedNativeQuery { public @interface NamedNativeQuery {
/** /**
* The name. It is a named query afterQuery all :) * The name. It is a named query afterQuery all :)

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.annotations; package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@ -22,6 +23,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/ */
@Target( { TYPE, PACKAGE }) @Target( { TYPE, PACKAGE })
@Retention(RUNTIME) @Retention(RUNTIME)
@Repeatable(NamedQueries.class)
public @interface NamedQuery { public @interface NamedQuery {
/** /**

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.annotations; package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@ -19,6 +20,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/ */
@Target({TYPE}) @Target({TYPE})
@Retention(RUNTIME) @Retention(RUNTIME)
@Repeatable(Tables.class)
public @interface Table { public @interface Table {
/** /**
* name of the targeted table. * name of the targeted table.

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.annotations; package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import org.hibernate.EntityMode; import org.hibernate.EntityMode;
@ -22,6 +23,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/ */
@java.lang.annotation.Target( {TYPE, FIELD, METHOD} ) @java.lang.annotation.Target( {TYPE, FIELD, METHOD} )
@Retention( RUNTIME ) @Retention( RUNTIME )
@Repeatable(Tuplizers.class)
public @interface Tuplizer { public @interface Tuplizer {
/** /**
* Tuplizer implementation. * Tuplizer implementation.

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.annotations; package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@ -30,6 +31,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/ */
@Target({TYPE, PACKAGE}) @Target({TYPE, PACKAGE})
@Retention(RUNTIME) @Retention(RUNTIME)
@Repeatable(TypeDefs.class)
public @interface TypeDef { public @interface TypeDef {
/** /**
* The type name. This is the name that would be used in other locations. * The type name. This is the name that would be used in other locations.

View File

@ -18,6 +18,7 @@ import javax.persistence.OneToOne;
import org.hibernate.AnnotationException; import org.hibernate.AnnotationException;
import org.hibernate.annotations.Columns; import org.hibernate.annotations.Columns;
import org.hibernate.annotations.Formula; import org.hibernate.annotations.Formula;
import org.hibernate.annotations.JoinColumnOrFormula;
import org.hibernate.annotations.JoinColumnsOrFormulas; import org.hibernate.annotations.JoinColumnsOrFormulas;
import org.hibernate.annotations.JoinFormula; import org.hibernate.annotations.JoinFormula;
import org.hibernate.annotations.common.reflection.XProperty; import org.hibernate.annotations.common.reflection.XProperty;
@ -31,6 +32,7 @@ import org.hibernate.internal.util.StringHelper;
* Also hosts some convenient methods related to column processing * Also hosts some convenient methods related to column processing
* *
* @author Emmanuel Bernard * @author Emmanuel Bernard
* @author Brett Meyer
*/ */
class ColumnsBuilder { class ColumnsBuilder {
private PropertyHolder propertyHolder; private PropertyHolder propertyHolder;
@ -184,24 +186,23 @@ class ColumnsBuilder {
Ejb3JoinColumn[] buildExplicitJoinColumns(XProperty property, PropertyData inferredData) { Ejb3JoinColumn[] buildExplicitJoinColumns(XProperty property, PropertyData inferredData) {
//process @JoinColumn(s) beforeQuery @Column(s) to handle collection of entities properly //process @JoinColumn(s) beforeQuery @Column(s) to handle collection of entities properly
Ejb3JoinColumn[] joinColumns = null; JoinColumn[] joinColumnAnnotations = null;
{
JoinColumn[] anns = null;
if ( property.isAnnotationPresent( JoinColumn.class ) ) { if ( property.isAnnotationPresent( JoinColumn.class ) ) {
anns = new JoinColumn[] { property.getAnnotation( JoinColumn.class ) }; joinColumnAnnotations = new JoinColumn[] { property.getAnnotation( JoinColumn.class ) };
} }
else if ( property.isAnnotationPresent( JoinColumns.class ) ) { else if ( property.isAnnotationPresent( JoinColumns.class ) ) {
JoinColumns ann = property.getAnnotation( JoinColumns.class ); JoinColumns joinColumnAnnotation = property.getAnnotation( JoinColumns.class );
anns = ann.value(); joinColumnAnnotations = joinColumnAnnotation.value();
int length = anns.length; int length = joinColumnAnnotations.length;
if ( length == 0 ) { if ( length == 0 ) {
throw new AnnotationException( "Cannot bind an empty @JoinColumns" ); throw new AnnotationException( "Cannot bind an empty @JoinColumns" );
} }
} }
if ( anns != null ) {
joinColumns = Ejb3JoinColumn.buildJoinColumns( if ( joinColumnAnnotations != null ) {
anns, return Ejb3JoinColumn.buildJoinColumns(
joinColumnAnnotations,
null, null,
entityBinder.getSecondaryTables(), entityBinder.getSecondaryTables(),
propertyHolder, propertyHolder,
@ -209,10 +210,26 @@ class ColumnsBuilder {
buildingContext buildingContext
); );
} }
JoinColumnOrFormula[] joinColumnOrFormulaAnnotations = null;
if ( property.isAnnotationPresent( JoinColumnOrFormula.class ) ) {
joinColumnOrFormulaAnnotations = new JoinColumnOrFormula[] {
property.getAnnotation( JoinColumnOrFormula.class ) };
}
else if ( property.isAnnotationPresent( JoinColumnsOrFormulas.class ) ) { else if ( property.isAnnotationPresent( JoinColumnsOrFormulas.class ) ) {
JoinColumnsOrFormulas ann = property.getAnnotation( JoinColumnsOrFormulas.class ); JoinColumnsOrFormulas joinColumnsOrFormulasAnnotations = property.getAnnotation(
joinColumns = Ejb3JoinColumn.buildJoinColumnsOrFormulas( JoinColumnsOrFormulas.class );
ann, joinColumnOrFormulaAnnotations = joinColumnsOrFormulasAnnotations.value();
int length = joinColumnOrFormulaAnnotations.length;
if ( length == 0 ) {
throw new AnnotationException( "Cannot bind an empty @JoinColumnsOrFormulas" );
}
}
if (joinColumnOrFormulaAnnotations != null) {
return Ejb3JoinColumn.buildJoinColumnsOrFormulas(
joinColumnOrFormulaAnnotations,
null, null,
entityBinder.getSecondaryTables(), entityBinder.getSecondaryTables(),
propertyHolder, propertyHolder,
@ -220,10 +237,11 @@ class ColumnsBuilder {
buildingContext buildingContext
); );
} }
else if (property.isAnnotationPresent( JoinFormula.class)) {
if (property.isAnnotationPresent( JoinFormula.class)) {
JoinFormula ann = property.getAnnotation( JoinFormula.class ); JoinFormula ann = property.getAnnotation( JoinFormula.class );
joinColumns = new Ejb3JoinColumn[1]; Ejb3JoinColumn[] ejb3JoinColumns = new Ejb3JoinColumn[1];
joinColumns[0] = Ejb3JoinColumn.buildJoinFormula( ejb3JoinColumns[0] = Ejb3JoinColumn.buildJoinFormula(
ann, ann,
null, null,
entityBinder.getSecondaryTables(), entityBinder.getSecondaryTables(),
@ -231,9 +249,10 @@ class ColumnsBuilder {
inferredData.getPropertyName(), inferredData.getPropertyName(),
buildingContext buildingContext
); );
return ejb3JoinColumns;
} }
}
return joinColumns; return null;
} }
Ejb3Column[] overrideColumnFromMapperOrMapsIdProperty(boolean isId) { Ejb3Column[] overrideColumnFromMapperOrMapsIdProperty(boolean isId) {

View File

@ -134,16 +134,15 @@ public class Ejb3JoinColumn extends Ejb3Column {
} }
public static Ejb3JoinColumn[] buildJoinColumnsOrFormulas( public static Ejb3JoinColumn[] buildJoinColumnsOrFormulas(
JoinColumnsOrFormulas anns, JoinColumnOrFormula[] anns,
String mappedBy, String mappedBy,
Map<String, Join> joins, Map<String, Join> joins,
PropertyHolder propertyHolder, PropertyHolder propertyHolder,
String propertyName, String propertyName,
MetadataBuildingContext buildingContext) { MetadataBuildingContext buildingContext) {
JoinColumnOrFormula [] ann = anns.value(); Ejb3JoinColumn [] joinColumns = new Ejb3JoinColumn[anns.length];
Ejb3JoinColumn [] joinColumns = new Ejb3JoinColumn[ann.length]; for (int i = 0; i < anns.length; i++) {
for (int i = 0; i < ann.length; i++) { JoinColumnOrFormula join = anns[i];
JoinColumnOrFormula join = ann[i];
JoinFormula formula = join.formula(); JoinFormula formula = join.formula();
if (formula.value() != null && !formula.value().equals("")) { if (formula.value() != null && !formula.value().equals("")) {
joinColumns[i] = buildJoinFormula( joinColumns[i] = buildJoinFormula(

View File

@ -24,7 +24,6 @@ import javax.persistence.QueryTimeoutException;
import org.hibernate.dialect.HSQLDialect; import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.Oracle10gDialect; import org.hibernate.dialect.Oracle10gDialect;
import org.hibernate.dialect.Oracle8iDialect;
import org.hibernate.dialect.PostgreSQL81Dialect; import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.SybaseASE15Dialect; import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.jpa.AvailableSettings; import org.hibernate.jpa.AvailableSettings;
@ -32,11 +31,9 @@ import org.hibernate.jpa.QueryHints;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase; import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.DialectChecks; import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
import org.junit.Test; import org.junit.Test;
@ -329,12 +326,10 @@ public class LockTest extends BaseEntityManagerFunctionalTestCase {
} }
@Test @Test
@SkipForDialects({ @SkipForDialect(HSQLDialect.class)
@SkipForDialect(HSQLDialect.class),
// ASE15.5 will generate select...holdlock and fail at this test, but ASE15.7 passes it. Skip it for ASE15.5 // ASE15.5 will generate select...holdlock and fail at this test, but ASE15.7 passes it. Skip it for ASE15.5
// only. // only.
@SkipForDialect(value = { SybaseASE15Dialect.class }, strictMatching = true, jiraKey = "HHH-6820") @SkipForDialect(value = { SybaseASE15Dialect.class }, strictMatching = true, jiraKey = "HHH-6820")
})
public void testContendedPessimisticLock() throws Exception { public void testContendedPessimisticLock() throws Exception {
final EntityManager em = getOrCreateEntityManager(); final EntityManager em = getOrCreateEntityManager();
final EntityManager isolatedEntityManager = createIsolatedEntityManager(); final EntityManager isolatedEntityManager = createIsolatedEntityManager();

View File

@ -35,9 +35,7 @@ import org.hibernate.jpa.test.Wallet;
import org.hibernate.stat.Statistics; import org.hibernate.stat.Statistics;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
import org.junit.Test; import org.junit.Test;
import junit.framework.Assert; import junit.framework.Assert;
@ -373,13 +371,9 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
} }
@Test @Test
@SkipForDialects( @SkipForDialect(value = Oracle8iDialect.class, jiraKey = "HHH-10161", comment = "Cannot convert untyped null (assumed to be BINARY type) to NUMBER")
value = { @SkipForDialect(value = PostgreSQL9Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = Oracle8iDialect.class, jiraKey = "HHH-10161", comment = "Cannot convert untyped null (assumed to be BINARY type) to NUMBER"),
@SkipForDialect(value = PostgreSQL9Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint"),
@SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint") @SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
}
)
public void testNativeQueryNullPositionalParameter() throws Exception { public void testNativeQueryNullPositionalParameter() throws Exception {
EntityManager em = getOrCreateEntityManager(); EntityManager em = getOrCreateEntityManager();
em.getTransaction().begin(); em.getTransaction().begin();
@ -412,13 +406,9 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
@Test @Test
@TestForIssue(jiraKey = "HHH-10161") @TestForIssue(jiraKey = "HHH-10161")
@SkipForDialects( @SkipForDialect(value = PostgreSQL9Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
value = { @SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = PostgreSQL9Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint"),
@SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint"),
@SkipForDialect(value = Oracle8iDialect.class, comment = "ORA-00932: inconsistent datatypes: expected NUMBER got BINARY") @SkipForDialect(value = Oracle8iDialect.class, comment = "ORA-00932: inconsistent datatypes: expected NUMBER got BINARY")
}
)
public void testNativeQueryNullPositionalParameterParameter() throws Exception { public void testNativeQueryNullPositionalParameterParameter() throws Exception {
EntityManager em = getOrCreateEntityManager(); EntityManager em = getOrCreateEntityManager();
em.getTransaction().begin(); em.getTransaction().begin();
@ -467,13 +457,9 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
} }
@Test @Test
@SkipForDialects( @SkipForDialect(value = Oracle8iDialect.class, jiraKey = "HHH-10161", comment = "Cannot convert untyped null (assumed to be BINARY type) to NUMBER")
value = { @SkipForDialect(value = PostgreSQL9Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = Oracle8iDialect.class, jiraKey = "HHH-10161", comment = "Cannot convert untyped null (assumed to be BINARY type) to NUMBER"),
@SkipForDialect(value = PostgreSQL9Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint"),
@SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint") @SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
}
)
public void testNativeQueryNullNamedParameter() throws Exception { public void testNativeQueryNullNamedParameter() throws Exception {
EntityManager em = getOrCreateEntityManager(); EntityManager em = getOrCreateEntityManager();
em.getTransaction().begin(); em.getTransaction().begin();
@ -506,13 +492,9 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
@Test @Test
@TestForIssue(jiraKey = "HHH-10161") @TestForIssue(jiraKey = "HHH-10161")
@SkipForDialects( @SkipForDialect(value = PostgreSQL9Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
value = { @SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = PostgreSQL9Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint"),
@SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint"),
@SkipForDialect(value = Oracle8iDialect.class, comment = "ORA-00932: inconsistent datatypes: expected NUMBER got BINARY") @SkipForDialect(value = Oracle8iDialect.class, comment = "ORA-00932: inconsistent datatypes: expected NUMBER got BINARY")
}
)
public void testNativeQueryNullNamedParameterParameter() throws Exception { public void testNativeQueryNullNamedParameterParameter() throws Exception {
EntityManager em = getOrCreateEntityManager(); EntityManager em = getOrCreateEntityManager();
em.getTransaction().begin(); em.getTransaction().begin();

View File

@ -6,7 +6,6 @@
*/ */
// $Id$ // $Id$
@AnyMetaDefs(
@AnyMetaDef( name= "Property", metaType = "string", idType = "integer", @AnyMetaDef( name= "Property", metaType = "string", idType = "integer",
metaValues = { metaValues = {
@MetaValue(value = "C", targetEntity = CharProperty.class), @MetaValue(value = "C", targetEntity = CharProperty.class),
@ -14,10 +13,9 @@
@MetaValue(value = "S", targetEntity = StringProperty.class), @MetaValue(value = "S", targetEntity = StringProperty.class),
@MetaValue(value = "L", targetEntity = LongProperty.class) @MetaValue(value = "L", targetEntity = LongProperty.class)
}) })
)
package org.hibernate.test.annotations.any; package org.hibernate.test.annotations.any;
import org.hibernate.annotations.AnyMetaDef; import org.hibernate.annotations.AnyMetaDef;
import org.hibernate.annotations.AnyMetaDefs;
import org.hibernate.annotations.MetaValue; import org.hibernate.annotations.MetaValue;

View File

@ -7,6 +7,7 @@
//$Id$ //$Id$
package org.hibernate.test.annotations.entity; package org.hibernate.test.annotations.entity;
import java.util.Set; import java.util.Set;
import javax.persistence.ElementCollection; import javax.persistence.ElementCollection;
import javax.persistence.Entity; import javax.persistence.Entity;
@ -17,7 +18,6 @@ import javax.persistence.Lob;
import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Filter; import org.hibernate.annotations.Filter;
import org.hibernate.annotations.FilterDef; import org.hibernate.annotations.FilterDef;
import org.hibernate.annotations.Filters;
import org.hibernate.annotations.Index; import org.hibernate.annotations.Index;
import org.hibernate.annotations.OptimisticLock; import org.hibernate.annotations.OptimisticLock;
import org.hibernate.annotations.OptimisticLockType; import org.hibernate.annotations.OptimisticLockType;
@ -41,10 +41,8 @@ import org.hibernate.annotations.Where;
polymorphism = PolymorphismType.EXPLICIT) polymorphism = PolymorphismType.EXPLICIT)
@Where(clause = "1=1") @Where(clause = "1=1")
@FilterDef(name = "minLength", parameters = {@ParamDef(name = "minLength", type = "integer")}) @FilterDef(name = "minLength", parameters = {@ParamDef(name = "minLength", type = "integer")})
@Filters({ @Filter(name = "betweenLength")
@Filter(name = "betweenLength"),
@Filter(name = "minLength", condition = ":minLength <= length") @Filter(name = "minLength", condition = ":minLength <= length")
})
@org.hibernate.annotations.Table(appliesTo = "Forest", @org.hibernate.annotations.Table(appliesTo = "Forest",
indexes = {@Index(name = "idx", columnNames = {"name", "length"})}) indexes = {@Index(name = "idx", columnNames = {"name", "length"})})
public class Forest { public class Forest {

View File

@ -9,8 +9,6 @@
* Test package for metatata facilities * Test package for metatata facilities
* It contains an example of filter metadata * It contains an example of filter metadata
*/ */
@FilterDefs(
{
@FilterDef( @FilterDef(
name = "betweenLength", name = "betweenLength",
defaultCondition = ":minLength <= length and :maxLength >= length", defaultCondition = ":minLength <= length and :maxLength >= length",
@ -19,23 +17,16 @@
@ParamDef(name = "maxLength", type = "integer") @ParamDef(name = "maxLength", type = "integer")
} }
) )
}
)
@TypeDefs(
{
@TypeDef( @TypeDef(
name = "caster", name = "caster",
typeClass = CasterStringType.class, typeClass = CasterStringType.class,
parameters = { parameters = {
@Parameter(name = "cast", value = "lower") @Parameter(name = "cast", value = "lower")
} }
)
}
) package org.hibernate.test.annotations.entity; ) package org.hibernate.test.annotations.entity;
import org.hibernate.annotations.FilterDef; import org.hibernate.annotations.FilterDef;
import org.hibernate.annotations.FilterDefs;
import org.hibernate.annotations.ParamDef; import org.hibernate.annotations.ParamDef;
import org.hibernate.annotations.Parameter; import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDef;
import org.hibernate.annotations.TypeDefs;

View File

@ -19,7 +19,9 @@ import javax.persistence.Id;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
import javax.persistence.JoinTable; import javax.persistence.JoinTable;
import org.hibernate.annotations.*; import org.hibernate.annotations.Formula;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
import org.hibernate.test.annotations.enumerated.custom_types.LastNumberType; import org.hibernate.test.annotations.enumerated.custom_types.LastNumberType;
import org.hibernate.test.annotations.enumerated.enums.Common; import org.hibernate.test.annotations.enumerated.enums.Common;
@ -32,7 +34,7 @@ import org.hibernate.test.annotations.enumerated.enums.Trimmed;
* @author Brett Meyer * @author Brett Meyer
*/ */
@Entity @Entity
@TypeDefs({ @TypeDef(typeClass = LastNumberType.class, defaultForType = LastNumber.class) }) @TypeDef(typeClass = LastNumberType.class, defaultForType = LastNumber.class)
public class EntityEnum { public class EntityEnum {
@Id @Id

View File

@ -6,24 +6,20 @@
*/ */
package org.hibernate.test.annotations.enumerated.custom_mapkey; package org.hibernate.test.annotations.enumerated.custom_mapkey;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.CollectionTable; import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.ElementCollection; import javax.persistence.ElementCollection;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.EnumType; import javax.persistence.EnumType;
import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.MapKeyColumn; import javax.persistence.MapKeyColumn;
import javax.persistence.MapKeyEnumerated; import javax.persistence.MapKeyEnumerated;
import java.util.HashMap;
import java.util.Map;
import org.hibernate.annotations.MapKeyType; import org.hibernate.annotations.MapKeyType;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDef;
import org.hibernate.annotations.TypeDefs;
import org.hibernate.test.annotations.enumerated.custom_types.LastNumberType; import org.hibernate.test.annotations.enumerated.custom_types.LastNumberType;
import org.hibernate.test.annotations.enumerated.enums.Common; import org.hibernate.test.annotations.enumerated.enums.Common;
@ -34,7 +30,7 @@ import org.hibernate.test.annotations.enumerated.enums.LastNumber;
* @author Janario Oliveira * @author Janario Oliveira
*/ */
@Entity @Entity
@TypeDefs({@TypeDef(typeClass = LastNumberType.class, defaultForType = LastNumber.class)}) @TypeDef(typeClass = LastNumberType.class, defaultForType = LastNumber.class)
public class EntityMapEnum { public class EntityMapEnum {
@Id @Id
@GeneratedValue @GeneratedValue

View File

@ -8,6 +8,7 @@
// $Id$ // $Id$
package org.hibernate.test.annotations.fetchprofile; package org.hibernate.test.annotations.fetchprofile;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import javax.persistence.Entity; import javax.persistence.Entity;
@ -19,23 +20,20 @@ import javax.persistence.OneToMany;
import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.FetchProfile; import org.hibernate.annotations.FetchProfile;
import org.hibernate.annotations.FetchProfiles;
/** /**
* @author Hardy Ferentschik * @author Hardy Ferentschik
*/ */
@Entity @Entity
@FetchProfiles( {
@FetchProfile(name = "customer-with-orders", fetchOverrides = { @FetchProfile(name = "customer-with-orders", fetchOverrides = {
@FetchProfile.FetchOverride(entity = Customer.class, association = "orders", mode = FetchMode.JOIN) @FetchProfile.FetchOverride(entity = Customer.class, association = "orders", mode = FetchMode.JOIN)
}), })
@FetchProfile(name = "customer-with-orders-and-country", @FetchProfile(name = "customer-with-orders-and-country",
fetchOverrides = { fetchOverrides = {
@FetchProfile.FetchOverride(entity = Customer.class, association = "orders", mode = FetchMode.JOIN), @FetchProfile.FetchOverride(entity = Customer.class, association = "orders", mode = FetchMode.JOIN),
@FetchProfile.FetchOverride(entity = Customer.class, association = "lastOrder", mode = FetchMode.JOIN), @FetchProfile.FetchOverride(entity = Customer.class, association = "lastOrder", mode = FetchMode.JOIN),
@FetchProfile.FetchOverride(entity = Order.class, association = "country", mode = FetchMode.JOIN) @FetchProfile.FetchOverride(entity = Order.class, association = "country", mode = FetchMode.JOIN)
}) })
})
public class Customer { public class Customer {
@Id @Id
@GeneratedValue @GeneratedValue

View File

@ -7,18 +7,16 @@
// $Id$ // $Id$
@FetchProfiles({
@FetchProfile(name = "package-profile-1", fetchOverrides = { @FetchProfile(name = "package-profile-1", fetchOverrides = {
@FetchProfile.FetchOverride(entity = Customer.class, association = "orders", mode = FetchMode.JOIN) @FetchProfile.FetchOverride(entity = Customer.class, association = "orders", mode = FetchMode.JOIN)
}), })
@FetchProfile(name = "package-profile-2", fetchOverrides = { @FetchProfile(name = "package-profile-2", fetchOverrides = {
@FetchProfile.FetchOverride(entity = Customer.class, association = "tickets", mode = FetchMode.JOIN) @FetchProfile.FetchOverride(entity = Customer.class, association = "tickets", mode = FetchMode.JOIN)
}) })
})
package org.hibernate.test.annotations.fetchprofile; package org.hibernate.test.annotations.fetchprofile;
import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.FetchProfile; import org.hibernate.annotations.FetchProfile;
import org.hibernate.annotations.FetchProfiles;

View File

@ -13,14 +13,11 @@ import javax.persistence.MappedSuperclass;
import org.hibernate.annotations.Filter; import org.hibernate.annotations.Filter;
import org.hibernate.annotations.FilterDef; import org.hibernate.annotations.FilterDef;
import org.hibernate.annotations.Filters;
import org.hibernate.annotations.ParamDef; import org.hibernate.annotations.ParamDef;
@MappedSuperclass @MappedSuperclass
@FilterDef(name = "nameFilter", parameters = @ParamDef(name = "name", type = "string")) @FilterDef(name = "nameFilter", parameters = @ParamDef(name = "name", type = "string"))
@Filters({
@Filter(name = "nameFilter", condition = ":name = ANIMAL_NAME") @Filter(name = "nameFilter", condition = ":name = ANIMAL_NAME")
})
public abstract class Animal { public abstract class Animal {
@Id @Id
@GeneratedValue @GeneratedValue

View File

@ -8,7 +8,6 @@ package org.hibernate.test.annotations.filter.subclass.joined;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
@ -17,15 +16,12 @@ import javax.persistence.OneToMany;
import org.hibernate.annotations.Filter; import org.hibernate.annotations.Filter;
import org.hibernate.annotations.FilterDef; import org.hibernate.annotations.FilterDef;
import org.hibernate.annotations.FilterDefs;
import org.hibernate.annotations.Filters;
import org.hibernate.annotations.ParamDef; import org.hibernate.annotations.ParamDef;
import org.hibernate.annotations.SqlFragmentAlias; import org.hibernate.annotations.SqlFragmentAlias;
@Entity @Entity
@FilterDefs({ @FilterDef(name="iqMin", parameters={@ParamDef(name="min", type="integer")})
@FilterDef(name="iqMin", parameters={@ParamDef(name="min", type="integer")}), @FilterDef(name="pregnantMembers")
@FilterDef(name="pregnantMembers")})
public class Club { public class Club {
@Id @Id
@GeneratedValue @GeneratedValue
@ -35,10 +31,8 @@ public class Club {
private String name; private String name;
@OneToMany(mappedBy="club") @OneToMany(mappedBy="club")
@Filters({ @Filter(name="iqMin", condition="{h}.HUMAN_IQ >= :min", aliases={@SqlFragmentAlias(alias="h", entity=Human.class)})
@Filter(name="iqMin", condition="{h}.HUMAN_IQ >= :min", aliases={@SqlFragmentAlias(alias="h", entity=Human.class)}),
@Filter(name="pregnantMembers", condition="{m}.IS_PREGNANT=1", aliases={@SqlFragmentAlias(alias="m", table="ZOOLOGY_MAMMAL")}) @Filter(name="pregnantMembers", condition="{m}.IS_PREGNANT=1", aliases={@SqlFragmentAlias(alias="m", table="ZOOLOGY_MAMMAL")})
})
private Set<Human> members = new HashSet<Human>(); private Set<Human> members = new HashSet<Human>();
public int getId() { public int getId() {

View File

@ -15,7 +15,6 @@ import javax.persistence.OneToMany;
import javax.persistence.Table; import javax.persistence.Table;
import org.hibernate.annotations.JoinColumnOrFormula; import org.hibernate.annotations.JoinColumnOrFormula;
import org.hibernate.annotations.JoinColumnsOrFormulas;
import org.hibernate.annotations.JoinFormula; import org.hibernate.annotations.JoinFormula;
import org.hibernate.boot.Metadata; import org.hibernate.boot.Metadata;
import org.hibernate.boot.MetadataSources; import org.hibernate.boot.MetadataSources;
@ -70,9 +69,7 @@ public class JoinColumnOrFormulaTest extends BaseUnitTestCase {
public Integer id; public Integer id;
@OneToMany @OneToMany
@JoinColumnsOrFormulas({
@JoinColumnOrFormula(formula = @JoinFormula(value = "idA", referencedColumnName = "idA")) @JoinColumnOrFormula(formula = @JoinFormula(value = "idA", referencedColumnName = "idA"))
})
Set<D> ds = new HashSet<D>(); Set<D> ds = new HashSet<D>();
} }

View File

@ -7,6 +7,7 @@
//$Id$ //$Id$
package org.hibernate.test.annotations.join; package org.hibernate.test.annotations.join;
import java.io.Serializable; import java.io.Serializable;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
@ -21,7 +22,6 @@ import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.Index; import org.hibernate.annotations.Index;
import org.hibernate.annotations.SQLInsert; import org.hibernate.annotations.SQLInsert;
import org.hibernate.annotations.Table; import org.hibernate.annotations.Table;
import org.hibernate.annotations.Tables;
/** /**
* @author Emmanuel Bernard * @author Emmanuel Bernard
@ -31,12 +31,10 @@ import org.hibernate.annotations.Tables;
@SecondaryTable(name = "`Cat nbr1`"), @SecondaryTable(name = "`Cat nbr1`"),
@SecondaryTable(name = "Cat2", uniqueConstraints = {@UniqueConstraint(columnNames = {"storyPart2"})}) @SecondaryTable(name = "Cat2", uniqueConstraints = {@UniqueConstraint(columnNames = {"storyPart2"})})
}) })
@Tables( {
@Table(appliesTo = "Cat", indexes = @Index(name = "secondname", @Table(appliesTo = "Cat", indexes = @Index(name = "secondname",
columnNames = "secondName"), comment = "My cat table" ), columnNames = "secondName"), comment = "My cat table" )
@Table(appliesTo = "Cat2", foreignKey = @ForeignKey(name="FK_CAT2_CAT"), fetch = FetchMode.SELECT, @Table(appliesTo = "Cat2", foreignKey = @ForeignKey(name="FK_CAT2_CAT"), fetch = FetchMode.SELECT,
sqlInsert=@SQLInsert(sql="insert into Cat2(storyPart2, id) values(upper(?), ?)") ) sqlInsert=@SQLInsert(sql="insert into Cat2(storyPart2, id) values(upper(?), ?)") )
} )
public class Cat implements Serializable { public class Cat implements Serializable {
private Integer id; private Integer id;

View File

@ -13,13 +13,12 @@ import javax.persistence.Lob;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDef;
import org.hibernate.annotations.TypeDefs;
/** /**
* @author Janario Oliveira * @author Janario Oliveira
*/ */
@Entity @Entity
@TypeDefs({ @TypeDef(typeClass = ImplicitSerializableType.class, defaultForType = ImplicitSerializable.class) }) @TypeDef(typeClass = ImplicitSerializableType.class, defaultForType = ImplicitSerializable.class)
public class EntitySerialize { public class EntitySerialize {
@Id @Id
@GeneratedValue @GeneratedValue

View File

@ -9,27 +9,23 @@
* Test package for metatata facilities * Test package for metatata facilities
* It contains an example of filter metadata * It contains an example of filter metadata
*/ */
@TypeDefs(
{
@TypeDef( @TypeDef(
name = "wrapped_char_text", name = "wrapped_char_text",
typeClass = org.hibernate.test.annotations.lob.CharacterArrayTextType.class typeClass = org.hibernate.test.annotations.lob.CharacterArrayTextType.class
), )
@TypeDef( @TypeDef(
name = "char_text", name = "char_text",
typeClass = org.hibernate.test.annotations.lob.PrimitiveCharacterArrayTextType.class typeClass = org.hibernate.test.annotations.lob.PrimitiveCharacterArrayTextType.class
), )
@TypeDef( @TypeDef(
name = "wrapped_image", name = "wrapped_image",
typeClass = org.hibernate.test.annotations.lob.WrappedImageType.class typeClass = org.hibernate.test.annotations.lob.WrappedImageType.class
), )
@TypeDef( @TypeDef(
name = "serializable_image", name = "serializable_image",
typeClass = org.hibernate.test.annotations.lob.SerializableToImageType.class typeClass = org.hibernate.test.annotations.lob.SerializableToImageType.class
) )
}
)
package org.hibernate.test.annotations.lob; package org.hibernate.test.annotations.lob;
import org.hibernate.annotations.TypeDef;
import org.hibernate.annotations.TypeDefs; import org.hibernate.annotations.TypeDef;

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.test.annotations.manytoonewithformula; package org.hibernate.test.annotations.manytoonewithformula;
import java.io.Serializable; import java.io.Serializable;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
@ -14,7 +15,6 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import org.hibernate.annotations.JoinColumnOrFormula; import org.hibernate.annotations.JoinColumnOrFormula;
import org.hibernate.annotations.JoinColumnsOrFormulas;
import org.hibernate.annotations.JoinFormula; import org.hibernate.annotations.JoinFormula;
/** /**
@ -36,11 +36,8 @@ public class Company implements Serializable {
} }
@ManyToOne @ManyToOne
@JoinColumnsOrFormulas( @JoinColumnOrFormula(column=@JoinColumn(name="id", referencedColumnName="company_id", updatable=false, insertable=false))
{
@JoinColumnOrFormula(column=@JoinColumn(name="id", referencedColumnName="company_id", updatable=false, insertable=false)),
@JoinColumnOrFormula(formula=@JoinFormula(value="'T'", referencedColumnName="is_default")) @JoinColumnOrFormula(formula=@JoinFormula(value="'T'", referencedColumnName="is_default"))
})
public Person getDefaultContactPerson() { public Person getDefaultContactPerson() {
return person; return person;
} }

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.test.annotations.manytoonewithformula; package org.hibernate.test.annotations.manytoonewithformula;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
@ -14,7 +15,6 @@ import javax.persistence.ManyToOne;
import javax.persistence.Table; import javax.persistence.Table;
import org.hibernate.annotations.JoinColumnOrFormula; import org.hibernate.annotations.JoinColumnOrFormula;
import org.hibernate.annotations.JoinColumnsOrFormulas;
import org.hibernate.annotations.JoinFormula; import org.hibernate.annotations.JoinFormula;
@Entity @Entity
@ -43,10 +43,9 @@ public class Contract {
} }
@ManyToOne @ManyToOne
@JoinColumnsOrFormulas( { @JoinColumnOrFormula(column = @JoinColumn(name = "CDT_MDL_CODE", referencedColumnName = "MDL_CODE"))
@JoinColumnOrFormula(column = @JoinColumn(name = "CDT_MDL_CODE", referencedColumnName = "MDL_CODE")), @JoinColumnOrFormula(formula = @JoinFormula(value = "CDT_MFG_CODE", referencedColumnName = "MDL_MFG_CODE"))
@JoinColumnOrFormula(formula = @JoinFormula(value = "CDT_MFG_CODE", referencedColumnName = "MDL_MFG_CODE")), @JoinColumnOrFormula(formula = @JoinFormula(value = "CDT_COMPANY_CODE", referencedColumnName = "MDL_COMPANY_CODE"))
@JoinColumnOrFormula(formula = @JoinFormula(value = "CDT_COMPANY_CODE", referencedColumnName = "MDL_COMPANY_CODE"))})
public Model getModel() { public Model getModel() {
return model; return model;
} }
@ -65,9 +64,8 @@ public class Contract {
} }
@ManyToOne @ManyToOne
@JoinColumnsOrFormulas( { @JoinColumnOrFormula(column = @JoinColumn(name = "CDT_MFG_CODE", referencedColumnName = "MFG_CODE"))
@JoinColumnOrFormula(column = @JoinColumn(name = "CDT_MFG_CODE", referencedColumnName = "MFG_CODE")), @JoinColumnOrFormula(formula = @JoinFormula(value = "CDT_COMPANY_CODE", referencedColumnName = "MFG_COMPANY_CODE"))
@JoinColumnOrFormula(formula = @JoinFormula(value = "CDT_COMPANY_CODE", referencedColumnName = "MFG_COMPANY_CODE")) })
public Manufacturer getManufacturer() { public Manufacturer getManufacturer() {
return manufacturer; return manufacturer;
} }

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.test.annotations.manytoonewithformula; package org.hibernate.test.annotations.manytoonewithformula;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
@ -13,7 +14,6 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import org.hibernate.annotations.JoinColumnOrFormula; import org.hibernate.annotations.JoinColumnOrFormula;
import org.hibernate.annotations.JoinColumnsOrFormulas;
import org.hibernate.annotations.JoinFormula; import org.hibernate.annotations.JoinFormula;
/** /**
@ -43,11 +43,8 @@ public class FoodItem {
} }
@ManyToOne @ManyToOne
@JoinColumnsOrFormulas( @JoinColumnOrFormula(column=@JoinColumn(name="order_nbr", referencedColumnName="order_nbr"))
{
@JoinColumnOrFormula(column=@JoinColumn(name="order_nbr", referencedColumnName="order_nbr")),
@JoinColumnOrFormula(formula=@JoinFormula(value="'F'", referencedColumnName="is_default")) @JoinColumnOrFormula(formula=@JoinFormula(value="'F'", referencedColumnName="is_default"))
})
public Menu getOrder() { public Menu getOrder() {
return order; return order;
} }

View File

@ -6,9 +6,6 @@
*/ */
package org.hibernate.test.annotations.manytoonewithformula; package org.hibernate.test.annotations.manytoonewithformula;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.Transaction; import org.hibernate.Transaction;
import org.hibernate.dialect.DB2Dialect; import org.hibernate.dialect.DB2Dialect;
@ -16,12 +13,15 @@ import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.Oracle8iDialect; import org.hibernate.dialect.Oracle8iDialect;
import org.hibernate.dialect.SQLServer2005Dialect; import org.hibernate.dialect.SQLServer2005Dialect;
import org.hibernate.dialect.TeradataDialect; import org.hibernate.dialect.TeradataDialect;
import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
/** /**
* @author Sharath Reddy * @author Sharath Reddy
*/ */
@ -136,13 +136,11 @@ public class ManyToOneWithFormulaTest extends BaseCoreFunctionalTestCase {
} }
@Test @Test
@SkipForDialects( { @SkipForDialect( value = { HSQLDialect.class }, comment = "The used join conditions does not work in HSQLDB. See HHH-4497." )
@SkipForDialect( value = { HSQLDialect.class }, comment = "The used join conditions does not work in HSQLDB. See HHH-4497." ), @SkipForDialect( value = { SQLServer2005Dialect.class } )
@SkipForDialect( value = { SQLServer2005Dialect.class } ), @SkipForDialect( value = { Oracle8iDialect.class }, comment = "Oracle/DB2 do not support 'substring' function" )
@SkipForDialect( value = { Oracle8iDialect.class }, comment = "Oracle/DB2 do not support 'substring' function" ), @SkipForDialect( value = { DB2Dialect.class }, comment = "Oracle/DB2 do not support 'substring' function" )
@SkipForDialect( value = { DB2Dialect.class }, comment = "Oracle/DB2 do not support 'substring' function" ), @SkipForDialect( value = { TeradataDialect.class }, comment = "Teradata doesn't support substring(?,?,?). \"substr\" would work." )
@SkipForDialect( value = {TeradataDialect.class }, comment = "Teradata doesn't support substring(?,?,?). \"substr\" would work." ),
} )
public void testManyToOneFromNonPkToNonPk() throws Exception { public void testManyToOneFromNonPkToNonPk() throws Exception {
// also tests usage of the stand-alone @JoinFormula annotation (i.e. not wrapped within @JoinColumnsOrFormulas) // also tests usage of the stand-alone @JoinFormula annotation (i.e. not wrapped within @JoinColumnsOrFormulas)
Session s = openSession(); Session s = openSession();

View File

@ -7,6 +7,7 @@
package org.hibernate.test.annotations.manytoonewithformula; package org.hibernate.test.annotations.manytoonewithformula;
import java.io.Serializable; import java.io.Serializable;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
@ -15,7 +16,6 @@ import javax.persistence.Id;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import org.hibernate.annotations.JoinColumnOrFormula; import org.hibernate.annotations.JoinColumnOrFormula;
import org.hibernate.annotations.JoinColumnsOrFormulas;
import org.hibernate.annotations.JoinFormula; import org.hibernate.annotations.JoinFormula;
/** /**
@ -58,11 +58,8 @@ public class Message implements Serializable {
} }
@ManyToOne @ManyToOne
@JoinColumnsOrFormulas(
{
@JoinColumnOrFormula(formula=@JoinFormula(value="UPPER(lang_code)")) @JoinColumnOrFormula(formula=@JoinFormula(value="UPPER(lang_code)"))
//@JoinColumnOrFormula(formula=@JoinFormula(value="(select l.code from Language l where l.name = lang_name)")) //@JoinColumnOrFormula(formula=@JoinFormula(value="(select l.code from Language l where l.name = lang_name)"))
})
public Language getLanguage() { public Language getLanguage() {
return language; return language;
} }

View File

@ -22,26 +22,22 @@ import org.hibernate.Session;
import org.hibernate.Transaction; import org.hibernate.Transaction;
import org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl; import org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl;
import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Configuration;
import org.hibernate.dialect.MySQL57InnoDBDialect;
import org.hibernate.dialect.Oracle8iDialect; import org.hibernate.dialect.Oracle8iDialect;
import org.hibernate.dialect.PostgreSQL81Dialect; import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.PostgreSQL92Dialect;
import org.hibernate.dialect.PostgreSQL9Dialect; import org.hibernate.dialect.PostgreSQL9Dialect;
import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.dialect.PostgresPlusDialect; import org.hibernate.dialect.PostgresPlusDialect;
import org.hibernate.dialect.function.SQLFunction; import org.hibernate.dialect.function.SQLFunction;
import org.hibernate.stat.Statistics; import org.hibernate.stat.Statistics;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.testing.FailureExpected; import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.hibernate.test.annotations.A320; import org.hibernate.test.annotations.A320;
import org.hibernate.test.annotations.A320b; import org.hibernate.test.annotations.A320b;
import org.hibernate.test.annotations.Plane; import org.hibernate.test.annotations.Plane;
import org.hibernate.type.StandardBasicTypes;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -103,13 +99,9 @@ public class QueryAndSQLTest extends BaseCoreFunctionalTestCase {
@Test @Test
@TestForIssue( jiraKey = "HHH-10161") @TestForIssue( jiraKey = "HHH-10161")
@SkipForDialects( @SkipForDialect(value = Oracle8iDialect.class, jiraKey = "HHH-10161", comment = "Cannot convert untyped null (assumed to be BINARY type) to NUMBER")
value = { @SkipForDialect(value = PostgreSQL9Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = Oracle8iDialect.class, jiraKey = "HHH-10161", comment = "Cannot convert untyped null (assumed to be BINARY type) to NUMBER"),
@SkipForDialect(value = PostgreSQL9Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint"),
@SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint") @SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
}
)
public void testQueryWithNullParameter(){ public void testQueryWithNullParameter(){
Chaos c0 = new Chaos(); Chaos c0 = new Chaos();
c0.setId( 0L ); c0.setId( 0L );
@ -190,13 +182,9 @@ public class QueryAndSQLTest extends BaseCoreFunctionalTestCase {
@Test @Test
@TestForIssue( jiraKey = "HHH-10161") @TestForIssue( jiraKey = "HHH-10161")
@SkipForDialects( @SkipForDialect(value = Oracle8iDialect.class, jiraKey = "HHH-10161", comment = "Cannot convert untyped null (assumed to be BINARY type) to NUMBER")
value = { @SkipForDialect(value = PostgreSQL9Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = Oracle8iDialect.class, jiraKey = "HHH-10161", comment = "Cannot convert untyped null (assumed to be BINARY type) to NUMBER"),
@SkipForDialect(value = PostgreSQL9Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint"),
@SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint") @SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
}
)
public void testNativeQueryWithNullParameter(){ public void testNativeQueryWithNullParameter(){
Chaos c0 = new Chaos(); Chaos c0 = new Chaos();
c0.setId( 0L ); c0.setId( 0L );

View File

@ -18,7 +18,6 @@ import org.hibernate.dialect.TeradataDialect;
import org.hibernate.persister.collection.BasicCollectionPersister; import org.hibernate.persister.collection.BasicCollectionPersister;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test; import org.junit.Test;
@ -30,13 +29,11 @@ import static org.junit.Assert.assertNotNull;
*/ */
public class Ejb3XmlTest extends BaseCoreFunctionalTestCase { public class Ejb3XmlTest extends BaseCoreFunctionalTestCase {
@Test @Test
@SkipForDialects({
@SkipForDialect(value = {PostgreSQL81Dialect.class, PostgreSQLDialect.class}, @SkipForDialect(value = {PostgreSQL81Dialect.class, PostgreSQLDialect.class},
comment = "postgresql jdbc driver does not implement the setQueryTimeout method"), comment = "postgresql jdbc driver does not implement the setQueryTimeout method")
@SkipForDialect(value = TeradataDialect.class, @SkipForDialect(value = TeradataDialect.class,
jiraKey = "HHH-8190", jiraKey = "HHH-8190",
comment = "uses Teradata reserved word - year") comment = "uses Teradata reserved word - year")
})
public void testEjb3Xml() throws Exception { public void testEjb3Xml() throws Exception {
Session s = openSession(); Session s = openSession();
Transaction tx = s.beginTransaction(); Transaction tx = s.beginTransaction();

View File

@ -16,15 +16,13 @@ import org.hibernate.Session;
import org.hibernate.Transaction; import org.hibernate.Transaction;
import org.hibernate.annotations.Nationalized; import org.hibernate.annotations.Nationalized;
import org.hibernate.criterion.Restrictions; import org.hibernate.criterion.Restrictions;
import org.hibernate.dialect.DB2Dialect; import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.PostgreSQL81Dialect; import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.junit.Test;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@ -32,10 +30,8 @@ import static org.junit.Assert.assertEquals;
* @author Chris Cranford (aka Naros) * @author Chris Cranford (aka Naros)
*/ */
@TestForIssue( jiraKey = "HHH-8657" ) @TestForIssue( jiraKey = "HHH-8657" )
@SkipForDialects({ @SkipForDialect(value = DB2Dialect.class, comment = "DB2 jdbc driver doesn't support setNString")
@SkipForDialect(value = DB2Dialect.class, comment = "DB2 jdbc driver doesn't support setNString"), @SkipForDialect(value = PostgreSQL81Dialect.class, comment = "PostgreSQL jdbc driver doesn't support setNString")
@SkipForDialect(value = PostgreSQL81Dialect.class, comment = "PostgreSQL jdbc driver doesn't support setNString"),
})
public class NationalizedIgnoreCaseTest extends BaseCoreFunctionalTestCase { public class NationalizedIgnoreCaseTest extends BaseCoreFunctionalTestCase {
@Override @Override

View File

@ -5,10 +5,6 @@
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/ */
package org.hibernate.test.cut; package org.hibernate.test.cut;
import javax.persistence.PersistenceException;
import static org.hibernate.testing.junit4.ExtraAssertions.assertTyping;
import static org.junit.Assert.assertEquals;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Currency; import java.util.Currency;
@ -25,11 +21,13 @@ import org.hibernate.hql.internal.ast.QuerySyntaxException;
import org.hibernate.testing.DialectChecks; import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test; import org.junit.Test;
import static org.hibernate.testing.junit4.ExtraAssertions.assertTyping;
import static org.junit.Assert.assertEquals;
/** /**
* @author Gavin King * @author Gavin King
*/ */
@ -71,9 +69,8 @@ public class CompositeUserTypeTest extends BaseCoreFunctionalTestCase {
} }
@Test @Test
@SkipForDialects( { @SkipForDialect ( value = { SybaseASE15Dialect.class }, jiraKey = "HHH-6788" )
@SkipForDialect ( value = { SybaseASE15Dialect.class }, jiraKey = "HHH-6788" ), @SkipForDialect ( value = { DB2Dialect.class }, jiraKey = "HHH-6867" )
@SkipForDialect ( value = { DB2Dialect.class }, jiraKey = "HHH-6867" ) } )
public void testCustomColumnReadAndWrite() { public void testCustomColumnReadAndWrite() {
Session s = openSession(); Session s = openSession();
org.hibernate.Transaction t = s.beginTransaction(); org.hibernate.Transaction t = s.beginTransaction();

View File

@ -6,24 +6,22 @@
*/ */
package org.hibernate.test.fetchprofiles.join.selfReferencing; package org.hibernate.test.fetchprofiles.join.selfReferencing;
import java.util.ArrayList;
import java.util.Collection;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.FetchType; import javax.persistence.FetchType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import javax.persistence.OneToMany; import javax.persistence.OneToMany;
import java.util.ArrayList;
import java.util.Collection;
import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.FetchProfile; import org.hibernate.annotations.FetchProfile;
import org.hibernate.annotations.FetchProfiles;
/** /**
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@Entity @Entity
@FetchProfiles(
@FetchProfile( @FetchProfile(
name = Employee.FETCH_PROFILE_TREE, name = Employee.FETCH_PROFILE_TREE,
fetchOverrides = { fetchOverrides = {
@ -31,7 +29,6 @@ import org.hibernate.annotations.FetchProfiles;
@FetchProfile.FetchOverride(entity = Employee.class, association = "minions", mode = FetchMode.JOIN) @FetchProfile.FetchOverride(entity = Employee.class, association = "minions", mode = FetchMode.JOIN)
} }
) )
)
public class Employee { public class Employee {
public final static String FETCH_PROFILE_TREE = "locationTree"; public final static String FETCH_PROFILE_TREE = "locationTree";

View File

@ -16,7 +16,6 @@ import javax.validation.constraints.NotNull;
import org.hibernate.annotations.Fetch; import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.JoinColumnOrFormula; import org.hibernate.annotations.JoinColumnOrFormula;
import org.hibernate.annotations.JoinColumnsOrFormulas;
import org.hibernate.annotations.JoinFormula; import org.hibernate.annotations.JoinFormula;
/** /**
@ -28,10 +27,8 @@ public class AnnotatedMaster {
private Integer id; private Integer id;
private String name; private String name;
@ManyToOne(fetch= FetchType.EAGER, optional=false) @ManyToOne(fetch= FetchType.EAGER, optional=false)
@JoinColumnsOrFormulas({ @JoinColumnOrFormula(formula=@JoinFormula(value="my_domain_key'", referencedColumnName="detail_domain"))
@JoinColumnOrFormula(formula=@JoinFormula(value="my_domain_key'", referencedColumnName="detail_domain")),
@JoinColumnOrFormula(column=@JoinColumn(name="detail", referencedColumnName="id")) @JoinColumnOrFormula(column=@JoinColumn(name="detail", referencedColumnName="id"))
})
@Fetch(FetchMode.JOIN) @Fetch(FetchMode.JOIN)
@NotNull @NotNull
private AnnotatedDetail detail; private AnnotatedDetail detail;

View File

@ -27,7 +27,6 @@ import org.hibernate.dialect.SybaseDialect;
import org.hibernate.tuple.ValueGenerator; import org.hibernate.tuple.ValueGenerator;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test; import org.junit.Test;
@ -44,10 +43,8 @@ import static org.junit.Assert.assertTrue;
* @author Steve Ebersole * @author Steve Ebersole
* @author Gunnar Morling * @author Gunnar Morling
*/ */
@SkipForDialects({ @SkipForDialect(value = SybaseDialect.class, comment = "CURRENT_TIMESTAMP not supported as default value in Sybase")
@SkipForDialect(value = SybaseDialect.class, comment = "CURRENT_TIMESTAMP not supported as default value in Sybase"),
@SkipForDialect(value = MySQLDialect.class, comment = "See HHH-10196", strictMatching = false) @SkipForDialect(value = MySQLDialect.class, comment = "See HHH-10196", strictMatching = false)
})
public class DefaultGeneratedValueTest extends BaseCoreFunctionalTestCase { public class DefaultGeneratedValueTest extends BaseCoreFunctionalTestCase {
@Test @Test

View File

@ -20,7 +20,6 @@ import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.dialect.function.SQLFunction; import org.hibernate.dialect.function.SQLFunction;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.SkipLog; import org.hibernate.testing.SkipLog;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test; import org.junit.Test;
@ -34,10 +33,8 @@ import static org.junit.Assert.assertTrue;
* *
* @author Gail Badner * @author Gail Badner
*/ */
@SkipForDialects({ @SkipForDialect( value = SybaseASE15Dialect.class, jiraKey = "HHH-6426")
@SkipForDialect( value = SybaseASE15Dialect.class, jiraKey = "HHH-6426"),
@SkipForDialect( value = PostgresPlusDialect.class, comment = "Almost all of the tests result in 'ambiguous column' errors.") @SkipForDialect( value = PostgresPlusDialect.class, comment = "Almost all of the tests result in 'ambiguous column' errors.")
})
public class FunctionNameAsColumnTest extends BaseCoreFunctionalTestCase { public class FunctionNameAsColumnTest extends BaseCoreFunctionalTestCase {
@Override @Override
public String[] getMappings() { public String[] getMappings() {

View File

@ -19,7 +19,6 @@ import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.DialectChecks; import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test; import org.junit.Test;
@ -62,9 +61,8 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase
} }
@Test @Test
@SkipForDialects(value = { @SkipForDialect(value = SybaseASE15Dialect.class , jiraKey = "HHH-5229")
@SkipForDialect(value = SybaseASE15Dialect.class , jiraKey = "HHH-5229"), @SkipForDialect(value = { AbstractHANADialect.class }, comment = "HANA only supports forward-only cursors.")
@SkipForDialect(value = { AbstractHANADialect.class }, comment = "HANA only supports forward-only cursors.") })
public void testScrollingJoinFetchesEmptyResultSet() { public void testScrollingJoinFetchesEmptyResultSet() {
Session s = openSession(); Session s = openSession();
Transaction txn = s.beginTransaction(); Transaction txn = s.beginTransaction();
@ -132,10 +130,9 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase
} }
@Test @Test
@SkipForDialects(value = {
@SkipForDialect(value = CUBRIDDialect.class, comment = "As of verion 8.4.1 CUBRID doesn't support temporary tables. This test fails with" @SkipForDialect(value = CUBRIDDialect.class, comment = "As of verion 8.4.1 CUBRID doesn't support temporary tables. This test fails with"
+ "HibernateException: cannot doAfterTransactionCompletion multi-table deletes using dialect not supporting temp tables"), + "HibernateException: cannot doAfterTransactionCompletion multi-table deletes using dialect not supporting temp tables")
@SkipForDialect(value = AbstractHANADialect.class, comment = "HANA only supports forward-only cursors") }) @SkipForDialect(value = AbstractHANADialect.class, comment = "HANA only supports forward-only cursors")
public void testScrollingJoinFetchesSingleRowResultSet() { public void testScrollingJoinFetchesSingleRowResultSet() {
Session s = openSession(); Session s = openSession();
Transaction txn = s.beginTransaction(); Transaction txn = s.beginTransaction();
@ -288,10 +285,9 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase
} }
@Test @Test
@SkipForDialects(value = {
@SkipForDialect(value = CUBRIDDialect.class, comment = "As of verion 8.4.1 CUBRID doesn't support temporary tables. This test fails with" @SkipForDialect(value = CUBRIDDialect.class, comment = "As of verion 8.4.1 CUBRID doesn't support temporary tables. This test fails with"
+ "HibernateException: cannot doAfterTransactionCompletion multi-table deletes using dialect not supporting temp tables"), + "HibernateException: cannot doAfterTransactionCompletion multi-table deletes using dialect not supporting temp tables")
@SkipForDialect(value = AbstractHANADialect.class, comment = "HANA only supports forward-only cursors.") }) @SkipForDialect(value = AbstractHANADialect.class, comment = "HANA only supports forward-only cursors.")
public void testScrollingJoinFetchesReverse() { public void testScrollingJoinFetchesReverse() {
TestData data = new TestData(); TestData data = new TestData();
data.prepare(); data.prepare();
@ -321,10 +317,9 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase
} }
@Test @Test
@SkipForDialects(value = {
@SkipForDialect(value = CUBRIDDialect.class, comment = "As of verion 8.4.1 CUBRID doesn't support temporary tables. This test fails with" @SkipForDialect(value = CUBRIDDialect.class, comment = "As of verion 8.4.1 CUBRID doesn't support temporary tables. This test fails with"
+ "HibernateException: cannot doAfterTransactionCompletion multi-table deletes using dialect not supporting temp tables"), + "HibernateException: cannot doAfterTransactionCompletion multi-table deletes using dialect not supporting temp tables")
@SkipForDialect(value = AbstractHANADialect.class, comment = "HANA only supports forward-only cursors.") }) @SkipForDialect(value = AbstractHANADialect.class, comment = "HANA only supports forward-only cursors.")
public void testScrollingJoinFetchesPositioning() { public void testScrollingJoinFetchesPositioning() {
TestData data = new TestData(); TestData data = new TestData();
data.prepare(); data.prepare();

View File

@ -6,10 +6,6 @@
*/ */
package org.hibernate.test.jpa.ql; package org.hibernate.test.jpa.ql;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -18,11 +14,15 @@ import org.hibernate.Query;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.dialect.MySQLDialect; import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.SQLServerDialect; import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
/** /**
* @author Janario Oliveira * @author Janario Oliveira
*/ */
@ -139,10 +139,8 @@ public class NamedNativeQueryTest extends BaseCoreFunctionalTestCase {
} }
@Test @Test
@SkipForDialects( { @SkipForDialect( value = MySQLDialect.class, comment = "MySQL appears to have trouble with fe.id selected twice in one statement")
@SkipForDialect( value = MySQLDialect.class, comment = "MySQL appears to have trouble with fe.id selected twice in one statement"),
@SkipForDialect( value = SQLServerDialect.class, comment = "SQL Server does not support the || operator.") @SkipForDialect( value = SQLServerDialect.class, comment = "SQL Server does not support the || operator.")
} )
// TODO: Re-form DestinationEntity.insertSelect to something more supported? // TODO: Re-form DestinationEntity.insertSelect to something more supported?
public void testInsertMultipleValues() { public void testInsertMultipleValues() {
final String name = "Name"; final String name = "Name";

View File

@ -12,14 +12,11 @@ import org.hibernate.LockMode;
import org.hibernate.LockOptions; import org.hibernate.LockOptions;
import org.hibernate.PessimisticLockException; import org.hibernate.PessimisticLockException;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.cfg.Configuration;
import org.hibernate.dialect.SybaseASE15Dialect; import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.exception.GenericJDBCException; import org.hibernate.exception.GenericJDBCException;
import org.hibernate.exception.LockAcquisitionException; import org.hibernate.exception.LockAcquisitionException;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.async.Executable; import org.hibernate.testing.async.Executable;
import org.hibernate.testing.async.TimedExecutor; import org.hibernate.testing.async.TimedExecutor;
@ -35,10 +32,8 @@ import static org.junit.Assert.fail;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@TestForIssue( jiraKey = "HHH-5275") @TestForIssue( jiraKey = "HHH-5275")
@SkipForDialects( {
@SkipForDialect(value=SybaseASE15Dialect.class, strictMatching=true, @SkipForDialect(value=SybaseASE15Dialect.class, strictMatching=true,
comment = "skip this test on Sybase ASE 15.5, but run it on 15.7, see HHH-6820") comment = "skip this test on Sybase ASE 15.5, but run it on 15.7, see HHH-6820")
})
public class LockModeTest extends BaseCoreFunctionalTestCase { public class LockModeTest extends BaseCoreFunctionalTestCase {
private Long id; private Long id;

View File

@ -6,6 +6,11 @@
*/ */
package org.hibernate.test.nationalized; package org.hibernate.test.nationalized;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.annotations.Nationalized; import org.hibernate.annotations.Nationalized;
import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.AvailableSettings;
@ -17,16 +22,9 @@ import org.hibernate.dialect.SybaseDialect;
import org.hibernate.resource.transaction.spi.TransactionStatus; import org.hibernate.resource.transaction.spi.TransactionStatus;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.junit.Test;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.fail; import static junit.framework.TestCase.fail;
@ -37,12 +35,10 @@ import static org.junit.Assert.assertThat;
* @author Andrea Boriero * @author Andrea Boriero
*/ */
@TestForIssue(jiraKey = "HHH-10364") @TestForIssue(jiraKey = "HHH-10364")
@SkipForDialects({ @SkipForDialect(value = DB2Dialect.class, comment = "DB2 jdbc driver doesn't support getNClob")
@SkipForDialect(value = DB2Dialect.class, comment = "DB2 jdbc driver doesn't support getNClob"), @SkipForDialect(value = MySQLDialect.class, comment = "MySQL/MariadB doesn't support nclob")
@SkipForDialect(value = MySQLDialect.class, comment = "MySQL/MariadB doesn't support nclob"), @SkipForDialect(value = PostgreSQL81Dialect.class, comment = "PostgreSQL doesn't support nclob")
@SkipForDialect(value = PostgreSQL81Dialect.class, comment = "PostgreSQL doesn't support nclob"),
@SkipForDialect(value = SybaseDialect.class, comment = "Sybase doesn't support nclob") @SkipForDialect(value = SybaseDialect.class, comment = "Sybase doesn't support nclob")
})
public class NationalizedLobFieldTest extends BaseCoreFunctionalTestCase { public class NationalizedLobFieldTest extends BaseCoreFunctionalTestCase {
@Override @Override

View File

@ -9,27 +9,25 @@ package org.hibernate.test.subselect;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.junit.Assert;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.dialect.DerbyDialect; import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.H2Dialect; import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.SQLServerDialect; import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.dialect.SybaseDialect; import org.hibernate.dialect.SybaseDialect;
import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
/** /**
* @author Strong Liu <stliu@hibernate.org> * @author Strong Liu <stliu@hibernate.org>
*/ */
@SkipForDialects({ @SkipForDialect(value = H2Dialect.class, comment = "H2 doesn't support this sql syntax")
@SkipForDialect(value = H2Dialect.class, comment = "H2 doesn't support this sql syntax"), @SkipForDialect(value = SQLServerDialect.class, comment = "mssql doesn't support multiple columns in the 'where' clause of a 'where in' query")
@SkipForDialect(value = SQLServerDialect.class, comment = "mssql doesn't support multiple columns in the 'where' clause of a 'where in' query"), @SkipForDialect(value = SybaseDialect.class, comment = "sybase doesn't support multiple columns in the 'where' clause of a 'where in' query")
@SkipForDialect(value = SybaseDialect.class, comment = "sybase doesn't support multiple columns in the 'where' clause of a 'where in' query"), @SkipForDialect(value = DerbyDialect.class, comment = "derby doesn't support multiple columns in the 'where' clause of a 'where in' query")
@SkipForDialect(value = DerbyDialect.class, comment = "derby doesn't support multiple columns in the 'where' clause of a 'where in' query")})
@TestForIssue( jiraKey = "HHH-8312") @TestForIssue( jiraKey = "HHH-8312")
public class CompositeIdTypeBindingTest extends BaseCoreFunctionalTestCase { public class CompositeIdTypeBindingTest extends BaseCoreFunctionalTestCase {
@Override @Override

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.envers; package org.hibernate.envers;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@ -30,6 +31,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/ */
@Target({TYPE, METHOD, FIELD}) @Target({TYPE, METHOD, FIELD})
@Retention(RUNTIME) @Retention(RUNTIME)
@Repeatable(AuditOverrides.class)
public @interface AuditOverride { public @interface AuditOverride {
/** /**

View File

@ -7,6 +7,7 @@
package org.hibernate.envers; package org.hibernate.envers;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@ -16,6 +17,7 @@ import java.lang.annotation.Target;
*/ */
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Repeatable(SecondaryAuditTables.class)
public @interface SecondaryAuditTable { public @interface SecondaryAuditTable {
String secondaryTableName(); String secondaryTableName();

View File

@ -7,6 +7,7 @@
package org.hibernate.testing; package org.hibernate.testing;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@ -23,6 +24,7 @@ import org.hibernate.dialect.Dialect;
*/ */
@Target({ ElementType.METHOD, ElementType.TYPE }) @Target({ ElementType.METHOD, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Repeatable(RequiresDialects.class)
public @interface RequiresDialect { public @interface RequiresDialect {
/** /**
* The dialects against which to run the test * The dialects against which to run the test

View File

@ -7,6 +7,7 @@
package org.hibernate.testing; package org.hibernate.testing;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@ -24,6 +25,7 @@ import org.hibernate.dialect.Dialect;
*/ */
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE }) @Target({ ElementType.METHOD, ElementType.TYPE })
@Repeatable(SkipForDialects.class)
public @interface SkipForDialect { public @interface SkipForDialect {
/** /**
* The dialects against which to skip the test * The dialects against which to skip the test