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.testing.RequiresDialect;
import org.hibernate.testing.RequiresDialects;
import org.junit.Before;
import org.junit.Test;
@ -1248,7 +1247,9 @@ public class HQLTest extends BaseEntityManagerFunctionalTestCase {
}
@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() {
doInJPA( this::entityManagerFactory, entityManager -> {
//tag::hql-bit-length-function-example[]
@ -1743,7 +1744,9 @@ public class HQLTest extends BaseEntityManagerFunctionalTestCase {
}
@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() {
doInJPA( this::entityManagerFactory, entityManager -> {
@ -1946,7 +1949,9 @@ public class HQLTest extends BaseEntityManagerFunctionalTestCase {
}
@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() {
doInJPA( this::entityManagerFactory, entityManager -> {
@ -2200,7 +2205,9 @@ public class HQLTest extends BaseEntityManagerFunctionalTestCase {
}
@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() {
doInJPA( this::entityManagerFactory, entityManager -> {
@ -2220,7 +2227,9 @@ public class HQLTest extends BaseEntityManagerFunctionalTestCase {
}
@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() {
doInJPA( this::entityManagerFactory, entityManager -> {

View File

@ -7,18 +7,15 @@
// $Id$
//tag::mapping-column-any-meta-def-example[]
@AnyMetaDefs(
@AnyMetaDef( name= "PropertyMetaDef", metaType = "string", idType = "long",
metaValues = {
@MetaValue(value = "S", targetEntity = StringProperty.class),
@MetaValue(value = "I", targetEntity = IntegerProperty.class)
}
)
)
@AnyMetaDef( name= "PropertyMetaDef", metaType = "string", idType = "long",
metaValues = {
@MetaValue(value = "S", targetEntity = StringProperty.class),
@MetaValue(value = "I", targetEntity = IntegerProperty.class)
}
)
package org.hibernate.userguide.mapping.basic.any;
import org.hibernate.annotations.AnyMetaDef;
import org.hibernate.annotations.AnyMetaDefs;
import org.hibernate.annotations.MetaValue;
//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.testing.RequiresDialect;
import org.hibernate.testing.RequiresDialects;
import org.hibernate.testing.TestForIssue;
import org.junit.Before;
import org.junit.Test;
@ -44,7 +43,8 @@ import static org.junit.Assert.assertEquals;
*
* @author Vlad Mihalcea
*/
@RequiresDialects(value = {@RequiresDialect(H2Dialect.class), @RequiresDialect(PostgreSQL82Dialect.class)})
@RequiresDialect(H2Dialect.class)
@RequiresDialect(PostgreSQL82Dialect.class)
public class CollectionLoaderTest extends BaseEntityManagerFunctionalTestCase {
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.testing.RequiresDialect;
import org.hibernate.testing.RequiresDialects;
import org.junit.Before;
import org.junit.Test;
@ -40,7 +39,8 @@ import static org.junit.Assert.assertNull;
/**
* @author Vlad Mihalcea
*/
@RequiresDialects(value = {@RequiresDialect(H2Dialect.class), @RequiresDialect(PostgreSQL82Dialect.class)})
@RequiresDialect(H2Dialect.class)
@RequiresDialect(PostgreSQL82Dialect.class)
public class CustomSQLSecondaryTableTest extends BaseEntityManagerFunctionalTestCase {
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.testing.RequiresDialect;
import org.hibernate.testing.RequiresDialects;
import org.junit.Before;
import org.junit.Test;
@ -42,7 +41,8 @@ import static org.junit.Assert.assertNull;
/**
* @author Vlad Mihalcea
*/
@RequiresDialects(value = {@RequiresDialect(H2Dialect.class), @RequiresDialect(PostgreSQL82Dialect.class)})
@RequiresDialect(H2Dialect.class)
@RequiresDialect(PostgreSQL82Dialect.class)
public class CustomSQLTest extends BaseEntityManagerFunctionalTestCase {
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.testing.RequiresDialect;
import org.hibernate.testing.RequiresDialects;
import org.junit.Before;
import org.junit.Test;
@ -397,7 +396,9 @@ public class SQLTest extends BaseEntityManagerFunctionalTestCase {
}
@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() {
doInJPA( this::entityManagerFactory, entityManager -> {
//tag::sql-jpa-entity-associations-query-one-to-many-join-example[]
@ -442,7 +443,9 @@ public class SQLTest extends BaseEntityManagerFunctionalTestCase {
}
@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() {
doInJPA( this::entityManagerFactory, entityManager -> {
Session session = entityManager.unwrap( Session.class );
@ -701,7 +704,9 @@ public class SQLTest extends BaseEntityManagerFunctionalTestCase {
}
@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() {
doInJPA( this::entityManagerFactory, entityManager -> {
//tag::sql-jpa-entity-associations_named-query-example[]
@ -720,7 +725,9 @@ public class SQLTest extends BaseEntityManagerFunctionalTestCase {
}
@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() {
doInJPA( this::entityManagerFactory, entityManager -> {
Session session = entityManager.unwrap( Session.class );

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
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 } )
@Retention( RUNTIME )
@Repeatable(AnyMetaDefs.class)
public @interface AnyMetaDef {
/**
* 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>.
*/
package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import static java.lang.annotation.ElementType.FIELD;
@ -24,6 +25,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/
@java.lang.annotation.Target({FIELD,METHOD})
@Retention(RUNTIME)
@Repeatable(ColumnTransformers.class)
public @interface ColumnTransformer {
/**
* (Logical) column name for which the expression is used.

View File

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

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@ -24,6 +25,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/
@Target({TYPE, METHOD, FIELD})
@Retention(RUNTIME)
@Repeatable(Filters.class)
public @interface Filter {
/**
* 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>.
*/
package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@ -20,6 +21,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/
@Target({TYPE, PACKAGE})
@Retention(RUNTIME)
@Repeatable(FilterDefs.class)
public @interface FilterDef {
/**
* The filter name.

View File

@ -7,6 +7,7 @@
package org.hibernate.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@ -19,6 +20,7 @@ import java.lang.annotation.Target;
*/
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(FilterJoinTables.class)
public @interface FilterJoinTable {
/**
* 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>.
*/
package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@ -21,6 +22,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/
@Target({PACKAGE, TYPE, METHOD, FIELD})
@Retention(RUNTIME)
@Repeatable(GenericGenerators.class)
public @interface GenericGenerator {
/**
* unique generator name.

View File

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

View File

@ -24,5 +24,5 @@ public @interface JoinColumnsOrFormulas {
/**
* The aggregated values.
*/
JoinColumnOrFormula [] value();
JoinColumnOrFormula[] value();
}

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>.
*/
package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@ -21,6 +23,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/
@Target({TYPE, PACKAGE})
@Retention(RUNTIME)
@Repeatable(NamedNativeQueries.class)
public @interface NamedNativeQuery {
/**
* The name. It is a named query afterQuery all :)

View File

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

View File

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

View File

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

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.annotations;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@ -30,6 +31,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
*/
@Target({TYPE, PACKAGE})
@Retention(RUNTIME)
@Repeatable(TypeDefs.class)
public @interface TypeDef {
/**
* 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.annotations.Columns;
import org.hibernate.annotations.Formula;
import org.hibernate.annotations.JoinColumnOrFormula;
import org.hibernate.annotations.JoinColumnsOrFormulas;
import org.hibernate.annotations.JoinFormula;
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
*
* @author Emmanuel Bernard
* @author Brett Meyer
*/
class ColumnsBuilder {
private PropertyHolder propertyHolder;
@ -184,56 +186,73 @@ class ColumnsBuilder {
Ejb3JoinColumn[] buildExplicitJoinColumns(XProperty property, PropertyData inferredData) {
//process @JoinColumn(s) beforeQuery @Column(s) to handle collection of entities properly
Ejb3JoinColumn[] joinColumns = null;
{
JoinColumn[] anns = null;
JoinColumn[] joinColumnAnnotations = null;
if ( property.isAnnotationPresent( JoinColumn.class ) ) {
anns = new JoinColumn[] { property.getAnnotation( JoinColumn.class ) };
}
else if ( property.isAnnotationPresent( JoinColumns.class ) ) {
JoinColumns ann = property.getAnnotation( JoinColumns.class );
anns = ann.value();
int length = anns.length;
if ( length == 0 ) {
throw new AnnotationException( "Cannot bind an empty @JoinColumns" );
}
}
if ( anns != null ) {
joinColumns = Ejb3JoinColumn.buildJoinColumns(
anns,
null,
entityBinder.getSecondaryTables(),
propertyHolder,
inferredData.getPropertyName(),
buildingContext
);
}
else if ( property.isAnnotationPresent( JoinColumnsOrFormulas.class ) ) {
JoinColumnsOrFormulas ann = property.getAnnotation( JoinColumnsOrFormulas.class );
joinColumns = Ejb3JoinColumn.buildJoinColumnsOrFormulas(
ann,
null,
entityBinder.getSecondaryTables(),
propertyHolder,
inferredData.getPropertyName(),
buildingContext
);
}
else if (property.isAnnotationPresent( JoinFormula.class)) {
JoinFormula ann = property.getAnnotation( JoinFormula.class );
joinColumns = new Ejb3JoinColumn[1];
joinColumns[0] = Ejb3JoinColumn.buildJoinFormula(
ann,
null,
entityBinder.getSecondaryTables(),
propertyHolder,
inferredData.getPropertyName(),
buildingContext
);
if ( property.isAnnotationPresent( JoinColumn.class ) ) {
joinColumnAnnotations = new JoinColumn[] { property.getAnnotation( JoinColumn.class ) };
}
else if ( property.isAnnotationPresent( JoinColumns.class ) ) {
JoinColumns joinColumnAnnotation = property.getAnnotation( JoinColumns.class );
joinColumnAnnotations = joinColumnAnnotation.value();
int length = joinColumnAnnotations.length;
if ( length == 0 ) {
throw new AnnotationException( "Cannot bind an empty @JoinColumns" );
}
}
return joinColumns;
if ( joinColumnAnnotations != null ) {
return Ejb3JoinColumn.buildJoinColumns(
joinColumnAnnotations,
null,
entityBinder.getSecondaryTables(),
propertyHolder,
inferredData.getPropertyName(),
buildingContext
);
}
JoinColumnOrFormula[] joinColumnOrFormulaAnnotations = null;
if ( property.isAnnotationPresent( JoinColumnOrFormula.class ) ) {
joinColumnOrFormulaAnnotations = new JoinColumnOrFormula[] {
property.getAnnotation( JoinColumnOrFormula.class ) };
}
else if ( property.isAnnotationPresent( JoinColumnsOrFormulas.class ) ) {
JoinColumnsOrFormulas joinColumnsOrFormulasAnnotations = property.getAnnotation(
JoinColumnsOrFormulas.class );
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,
entityBinder.getSecondaryTables(),
propertyHolder,
inferredData.getPropertyName(),
buildingContext
);
}
if (property.isAnnotationPresent( JoinFormula.class)) {
JoinFormula ann = property.getAnnotation( JoinFormula.class );
Ejb3JoinColumn[] ejb3JoinColumns = new Ejb3JoinColumn[1];
ejb3JoinColumns[0] = Ejb3JoinColumn.buildJoinFormula(
ann,
null,
entityBinder.getSecondaryTables(),
propertyHolder,
inferredData.getPropertyName(),
buildingContext
);
return ejb3JoinColumns;
}
return null;
}
Ejb3Column[] overrideColumnFromMapperOrMapsIdProperty(boolean isId) {

View File

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

View File

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

View File

@ -35,9 +35,7 @@ import org.hibernate.jpa.test.Wallet;
import org.hibernate.stat.Statistics;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.TestForIssue;
import org.junit.Test;
import junit.framework.Assert;
@ -373,13 +371,9 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
}
@Test
@SkipForDialects(
value = {
@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 = 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")
public void testNativeQueryNullPositionalParameter() throws Exception {
EntityManager em = getOrCreateEntityManager();
em.getTransaction().begin();
@ -412,13 +406,9 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
@Test
@TestForIssue(jiraKey = "HHH-10161")
@SkipForDialects(
value = {
@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 = 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")
public void testNativeQueryNullPositionalParameterParameter() throws Exception {
EntityManager em = getOrCreateEntityManager();
em.getTransaction().begin();
@ -467,13 +457,9 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
}
@Test
@SkipForDialects(
value = {
@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 = 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")
public void testNativeQueryNullNamedParameter() throws Exception {
EntityManager em = getOrCreateEntityManager();
em.getTransaction().begin();
@ -506,13 +492,9 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
@Test
@TestForIssue(jiraKey = "HHH-10161")
@SkipForDialects(
value = {
@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 = 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")
public void testNativeQueryNullNamedParameterParameter() throws Exception {
EntityManager em = getOrCreateEntityManager();
em.getTransaction().begin();

View File

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

View File

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

View File

@ -9,33 +9,24 @@
* Test package for metatata facilities
* It contains an example of filter metadata
*/
@FilterDefs(
{
@FilterDef(
name = "betweenLength",
defaultCondition = ":minLength <= length and :maxLength >= length",
parameters = {
@FilterDef(
name = "betweenLength",
defaultCondition = ":minLength <= length and :maxLength >= length",
parameters = {
@ParamDef(name = "minLength", type = "integer"),
@ParamDef(name = "maxLength", type = "integer")
}
)
}
}
)
@TypeDefs(
{
@TypeDef(
name = "caster",
typeClass = CasterStringType.class,
parameters = {
@TypeDef(
name = "caster",
typeClass = CasterStringType.class,
parameters = {
@Parameter(name = "cast", value = "lower")
}
)
}
}
) package org.hibernate.test.annotations.entity;
import org.hibernate.annotations.FilterDef;
import org.hibernate.annotations.FilterDefs;
import org.hibernate.annotations.ParamDef;
import org.hibernate.annotations.Parameter;
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.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.enums.Common;
@ -32,7 +34,7 @@ import org.hibernate.test.annotations.enumerated.enums.Trimmed;
* @author Brett Meyer
*/
@Entity
@TypeDefs({ @TypeDef(typeClass = LastNumberType.class, defaultForType = LastNumber.class) })
@TypeDef(typeClass = LastNumberType.class, defaultForType = LastNumber.class)
public class EntityEnum {
@Id

View File

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

View File

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

View File

@ -7,18 +7,16 @@
// $Id$
@FetchProfiles({
@FetchProfile(name = "package-profile-1", fetchOverrides = {
@FetchProfile.FetchOverride(entity = Customer.class, association = "orders", mode = FetchMode.JOIN)
}),
@FetchProfile(name = "package-profile-2", fetchOverrides = {
@FetchProfile.FetchOverride(entity = Customer.class, association = "tickets", mode = FetchMode.JOIN)
})
@FetchProfile(name = "package-profile-1", fetchOverrides = {
@FetchProfile.FetchOverride(entity = Customer.class, association = "orders", mode = FetchMode.JOIN)
})
@FetchProfile(name = "package-profile-2", fetchOverrides = {
@FetchProfile.FetchOverride(entity = Customer.class, association = "tickets", mode = FetchMode.JOIN)
})
package org.hibernate.test.annotations.fetchprofile;
import org.hibernate.annotations.FetchMode;
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.FilterDef;
import org.hibernate.annotations.Filters;
import org.hibernate.annotations.ParamDef;
@MappedSuperclass
@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 {
@Id
@GeneratedValue

View File

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

View File

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

View File

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

View File

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

View File

@ -9,27 +9,23 @@
* Test package for metatata facilities
* It contains an example of filter metadata
*/
@TypeDefs(
{
@TypeDef(
name = "wrapped_char_text",
typeClass = org.hibernate.test.annotations.lob.CharacterArrayTextType.class
),
@TypeDef(
name = "char_text",
typeClass = org.hibernate.test.annotations.lob.PrimitiveCharacterArrayTextType.class
),
@TypeDef(
name = "wrapped_image",
typeClass = org.hibernate.test.annotations.lob.WrappedImageType.class
),
@TypeDef(
name = "serializable_image",
typeClass = org.hibernate.test.annotations.lob.SerializableToImageType.class
@TypeDef(
name = "wrapped_char_text",
typeClass = org.hibernate.test.annotations.lob.CharacterArrayTextType.class
)
}
@TypeDef(
name = "char_text",
typeClass = org.hibernate.test.annotations.lob.PrimitiveCharacterArrayTextType.class
)
@TypeDef(
name = "wrapped_image",
typeClass = org.hibernate.test.annotations.lob.WrappedImageType.class
)
@TypeDef(
name = "serializable_image",
typeClass = org.hibernate.test.annotations.lob.SerializableToImageType.class
)
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;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
@ -14,7 +15,6 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import org.hibernate.annotations.JoinColumnOrFormula;
import org.hibernate.annotations.JoinColumnsOrFormulas;
import org.hibernate.annotations.JoinFormula;
/**
@ -36,11 +36,8 @@ public class Company implements Serializable {
}
@ManyToOne
@JoinColumnsOrFormulas(
{
@JoinColumnOrFormula(column=@JoinColumn(name="id", referencedColumnName="company_id", updatable=false, insertable=false)),
@JoinColumnOrFormula(formula=@JoinFormula(value="'T'", referencedColumnName="is_default"))
})
@JoinColumnOrFormula(column=@JoinColumn(name="id", referencedColumnName="company_id", updatable=false, insertable=false))
@JoinColumnOrFormula(formula=@JoinFormula(value="'T'", referencedColumnName="is_default"))
public Person getDefaultContactPerson() {
return person;
}

View File

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

View File

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

View File

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

View File

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

View File

@ -22,26 +22,22 @@ import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl;
import org.hibernate.cfg.Configuration;
import org.hibernate.dialect.MySQL57InnoDBDialect;
import org.hibernate.dialect.Oracle8iDialect;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.PostgreSQL92Dialect;
import org.hibernate.dialect.PostgreSQL9Dialect;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.dialect.PostgresPlusDialect;
import org.hibernate.dialect.function.SQLFunction;
import org.hibernate.stat.Statistics;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.hibernate.test.annotations.A320;
import org.hibernate.test.annotations.A320b;
import org.hibernate.test.annotations.Plane;
import org.hibernate.type.StandardBasicTypes;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@ -103,13 +99,9 @@ public class QueryAndSQLTest extends BaseCoreFunctionalTestCase {
@Test
@TestForIssue( jiraKey = "HHH-10161")
@SkipForDialects(
value = {
@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 = 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")
public void testQueryWithNullParameter(){
Chaos c0 = new Chaos();
c0.setId( 0L );
@ -190,13 +182,9 @@ public class QueryAndSQLTest extends BaseCoreFunctionalTestCase {
@Test
@TestForIssue( jiraKey = "HHH-10161")
@SkipForDialects(
value = {
@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 = 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")
public void testNativeQueryWithNullParameter(){
Chaos c0 = new Chaos();
c0.setId( 0L );

View File

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

View File

@ -16,15 +16,13 @@ import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.annotations.Nationalized;
import org.hibernate.criterion.Restrictions;
import org.hibernate.dialect.DB2Dialect;
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.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
@ -32,10 +30,8 @@ import static org.junit.Assert.assertEquals;
* @author Chris Cranford (aka Naros)
*/
@TestForIssue( jiraKey = "HHH-8657" )
@SkipForDialects({
@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 = DB2Dialect.class, comment = "DB2 jdbc driver doesn't support setNString")
@SkipForDialect(value = PostgreSQL81Dialect.class, comment = "PostgreSQL jdbc driver doesn't support setNString")
public class NationalizedIgnoreCaseTest extends BaseCoreFunctionalTestCase {
@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>.
*/
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.util.Currency;
@ -25,11 +21,13 @@ import org.hibernate.hql.internal.ast.QuerySyntaxException;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test;
import static org.hibernate.testing.junit4.ExtraAssertions.assertTyping;
import static org.junit.Assert.assertEquals;
/**
* @author Gavin King
*/
@ -71,9 +69,8 @@ public class CompositeUserTypeTest extends BaseCoreFunctionalTestCase {
}
@Test
@SkipForDialects( {
@SkipForDialect ( value = { SybaseASE15Dialect.class }, jiraKey = "HHH-6788" ),
@SkipForDialect ( value = { DB2Dialect.class }, jiraKey = "HHH-6867" ) } )
@SkipForDialect ( value = { SybaseASE15Dialect.class }, jiraKey = "HHH-6788" )
@SkipForDialect ( value = { DB2Dialect.class }, jiraKey = "HHH-6867" )
public void testCustomColumnReadAndWrite() {
Session s = openSession();
org.hibernate.Transaction t = s.beginTransaction();

View File

@ -6,31 +6,28 @@
*/
package org.hibernate.test.fetchprofiles.join.selfReferencing;
import java.util.ArrayList;
import java.util.Collection;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import java.util.ArrayList;
import java.util.Collection;
import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.FetchProfile;
import org.hibernate.annotations.FetchProfiles;
/**
* @author Steve Ebersole
*/
@Entity
@FetchProfiles(
@FetchProfile(
name = Employee.FETCH_PROFILE_TREE,
fetchOverrides = {
@FetchProfile.FetchOverride(entity = Employee.class, association = "manager", mode = FetchMode.JOIN),
@FetchProfile.FetchOverride(entity = Employee.class, association = "minions", mode = FetchMode.JOIN)
}
)
@FetchProfile(
name = Employee.FETCH_PROFILE_TREE,
fetchOverrides = {
@FetchProfile.FetchOverride(entity = Employee.class, association = "manager", mode = FetchMode.JOIN),
@FetchProfile.FetchOverride(entity = Employee.class, association = "minions", mode = FetchMode.JOIN)
}
)
public class Employee {
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.FetchMode;
import org.hibernate.annotations.JoinColumnOrFormula;
import org.hibernate.annotations.JoinColumnsOrFormulas;
import org.hibernate.annotations.JoinFormula;
/**
@ -28,10 +27,8 @@ public class AnnotatedMaster {
private Integer id;
private String name;
@ManyToOne(fetch= FetchType.EAGER, optional=false)
@JoinColumnsOrFormulas({
@JoinColumnOrFormula(formula=@JoinFormula(value="my_domain_key'", referencedColumnName="detail_domain")),
@JoinColumnOrFormula(column=@JoinColumn(name="detail", referencedColumnName="id"))
})
@JoinColumnOrFormula(formula=@JoinFormula(value="my_domain_key'", referencedColumnName="detail_domain"))
@JoinColumnOrFormula(column=@JoinColumn(name="detail", referencedColumnName="id"))
@Fetch(FetchMode.JOIN)
@NotNull
private AnnotatedDetail detail;

View File

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

View File

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

View File

@ -19,7 +19,6 @@ import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test;
@ -62,9 +61,8 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase
}
@Test
@SkipForDialects(value = {
@SkipForDialect(value = SybaseASE15Dialect.class , jiraKey = "HHH-5229"),
@SkipForDialect(value = { AbstractHANADialect.class }, comment = "HANA only supports forward-only cursors.") })
@SkipForDialect(value = SybaseASE15Dialect.class , jiraKey = "HHH-5229")
@SkipForDialect(value = { AbstractHANADialect.class }, comment = "HANA only supports forward-only cursors.")
public void testScrollingJoinFetchesEmptyResultSet() {
Session s = openSession();
Transaction txn = s.beginTransaction();
@ -132,10 +130,9 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase
}
@Test
@SkipForDialects(value = {
@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"),
@SkipForDialect(value = AbstractHANADialect.class, comment = "HANA only supports forward-only cursors") })
@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")
@SkipForDialect(value = AbstractHANADialect.class, comment = "HANA only supports forward-only cursors")
public void testScrollingJoinFetchesSingleRowResultSet() {
Session s = openSession();
Transaction txn = s.beginTransaction();
@ -288,10 +285,9 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase
}
@Test
@SkipForDialects(value = {
@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"),
@SkipForDialect(value = AbstractHANADialect.class, comment = "HANA only supports forward-only cursors.") })
@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")
@SkipForDialect(value = AbstractHANADialect.class, comment = "HANA only supports forward-only cursors.")
public void testScrollingJoinFetchesReverse() {
TestData data = new TestData();
data.prepare();
@ -321,10 +317,9 @@ public class ScrollableCollectionFetchingTest extends BaseCoreFunctionalTestCase
}
@Test
@SkipForDialects(value = {
@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"),
@SkipForDialect(value = AbstractHANADialect.class, comment = "HANA only supports forward-only cursors.") })
@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")
@SkipForDialect(value = AbstractHANADialect.class, comment = "HANA only supports forward-only cursors.")
public void testScrollingJoinFetchesPositioning() {
TestData data = new TestData();
data.prepare();

View File

@ -6,10 +6,6 @@
*/
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.Collections;
import java.util.List;
@ -18,11 +14,15 @@ import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
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
*/
@ -139,10 +139,8 @@ public class NamedNativeQueryTest extends BaseCoreFunctionalTestCase {
}
@Test
@SkipForDialects( {
@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 = 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.")
// TODO: Re-form DestinationEntity.insertSelect to something more supported?
public void testInsertMultipleValues() {
final String name = "Name";

View File

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

View File

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

View File

@ -9,27 +9,25 @@ package org.hibernate.test.subselect;
import java.util.ArrayList;
import java.util.List;
import org.junit.Assert;
import org.hibernate.Session;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.SkipForDialects;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Assert;
import org.junit.Test;
/**
* @author Strong Liu <stliu@hibernate.org>
*/
@SkipForDialects({
@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 = 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 = 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 = 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")
@TestForIssue( jiraKey = "HHH-8312")
public class CompositeIdTypeBindingTest extends BaseCoreFunctionalTestCase {
@Override

View File

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

View File

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

View File

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

View File

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