@JoinColumn(table = "...") doesn't use NamingStrategy

Description

@JoinColumn(table = "...") doesn't use NamingStrategy.
For example:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 @Entity @SecondaryTable(name = "ExtendedLife") public class Life implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "LIFE_ID") public Integer id; public int duration; @Column(table = "ExtendedLife") public String fullDescription; @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) @JoinColumn(name = "CAT_ID", table = "ExtendedLife") public Cat owner; }

It's Ok with DefaultNamingStrategy.

But it throws exception with overrided strategy:

1 2 3 4 5 6 public class TestNamingStrategy extends DefaultNamingStrategy { @Override public String tableName(String tableName) { return "TAB_" + tableName; } }

StackTrace:

1 2 3 Caused by: org.hibernate.AnnotationException: Cannot find the expected secondary table: no ExtendedLife available for org.hibernate.test.annotations.join.Life at org.hibernate.cfg.Ejb3Column.getJoin(Ejb3Column.java:363) at org.hibernate.cfg.Ejb3Column.getTable(Ejb3Column.java:342)

Environment

None

Status

Assignee

Brett Meyer

Reporter

Sergey Vasilyev

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

4.2.5

Priority

Major
Configure