Hi, I'm having problem with @AuditJoinTable annotation as i wants to change audit join table name, I tried adding annotation on owning side and also on both side but still its creating audit join table with default name.
Here is the testcase for this.
Student.Java
@Audited
public class Student {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique=true, nullable=false)
private long id;
private String name;
private String degree;
private String roll;
private Set<Phone> phone;
getter and setter methods
Phone.java
@Audited
public class Phone {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
@AuditJoinTable(name="custom_join_table")
private Student student;
private long phone;
getter and setter methods
Having xml based mapping as follows:
Student.hbm.xml
.....
<set name="phone" inverse="false" cascade="save-update">
<key column="STUDENT_ID"></key>
<one-to-many class="com.jwt.hibernate.Phone"/>
</set>
.....
Phone.hbm.xml
....
<many-to-one
name="student"
class="com.jwt.hibernate.Student"
column="STUDENT_ID" />
.....
when i perform any operation (add/edit) it works fine along with audit results, it also generates audit join table with name Student_Phone_aud, which i wants to change. Thus neither it works not throwing any exception.
|