-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: ImprovedNamingStrategy join table naming
PostPosted: Fri Nov 07, 2014 1:27 pm 
Newbie

Joined: Fri Nov 07, 2014 1:17 pm
Posts: 3
I'm using ImprovedNamingStrategy in my application and omitting JPA annotations like @Column. So far I have been happy with it, but I'm seeing weird plural naming with a @ManyToMany join table.

Here's the relevant Java code:

Code:
@Entity
public class Specialty
{
    private int fId;
   
    private List<Variable> fVariables = new ArrayList<>();

    public Specialty()
    {
    }
   
    @Id
    public int getId()
    {
        return fId;
    }

    void setId(int id)
    {
        this.fId = id;
    }

    [...snip...]
   
    @ManyToMany(fetch = FetchType.LAZY)
    public List<Variable> getVariables()
    {
        return fVariables;
    }

    void setVariables(List<Variable> variables)
    {
        fVariables = variables;
    }
   
}


This generates a join table like:

Code:
specialty_variables
-------------------
specialty integer
variables integer

whereas I expected

Code:
specialty_variable
------------------
specialty_id integer
variable_id integer

Why the pluralization?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.