Skip to content

HHH-19285 : @ManyToAny with @FilterJoinTable KO #9901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.orm.test.associations.any;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.JoinTable;
import org.hibernate.annotations.AnyKeyJavaClass;
import org.hibernate.annotations.FilterJoinTable;
import org.hibernate.annotations.ManyToAny;
import org.hibernate.boot.MetadataSources;
import org.hibernate.testing.orm.junit.JiraKey;
import org.hibernate.testing.orm.junit.NotImplementedYet;
import org.hibernate.testing.orm.junit.ServiceRegistry;
import org.hibernate.testing.orm.junit.ServiceRegistryScope;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;
import java.util.List;


/**
* The annotation @FilterJoinTable is incorrectly not accepted by @ManyToAny, which always utilizes a @JoinTable.
*
* @author Vincent Bouthinon
*/
@ServiceRegistry()
@JiraKey("HHH-19285")
class ManyToAnyWithFilterJoinTableTest {

@NotImplementedYet
@Test
void testManyToAnyWithFilterJoinTable(ServiceRegistryScope registryScope) {
final MetadataSources metadataSources = new MetadataSources( registryScope.getRegistry() )
.addAnnotatedClasses( ObjectTest.class );
metadataSources.buildMetadata();
}

@Entity
public static class ObjectTest {

@Id
@GeneratedValue
private Long id;

@ManyToAny
@AnyKeyJavaClass( Long.class )
@JoinTable(name = "linkTable", joinColumns = @JoinColumn(name = "SOURCE"), inverseJoinColumns = @JoinColumn(name = "DEST"))
@FilterJoinTable(name= "filter", condition = "1=1")
private List<Object> list = new ArrayList<>();
}
}
Loading