2 Replies Latest reply on Mar 25, 2006 11:50 PM by treespace

    Default JoinColumn name

    treespace Novice

      I am getting frustrated in my attempt to use default names since I don't know what they are and cannot find a reference. Table and column names were changed from underscores to camel-case so no problem there: what you see is what you get. My relations, however, are another story.

      What is the default join column from a book to its category? I think it's CATEGORY_ID. Where can I see in black-and-white (or suitable color:) what the default naming rules are? Since I have control of the schema I want to leverage defaults as much as is practical.

      
      class Category
      {
       ...
       @Id @GeneratedValue(strategy = GenerationType.AUTO) public long getId()...
      
       @OneToMany(mappedBy = "category") public List<Books> getBooks()...
       ...
      }
      
      class Book
      {
       ...
       @Id @GeneratedValue(strategy = GenerationType.AUTO) public long getId()...
      
       @ManyToOne public Category getCategory()...
       ...
      }