[hibernate-dev] Naming and "naming strategies"

Steve Ebersole steve at hibernate.org
Fri Jan 16 12:37:10 EST 2015


On Fri, Jan 16, 2015 at 8:10 AM, Steve Ebersole <steve at hibernate.org> wrote:
>
>
>> I have one question, regarding logical name. The name that a given user
>> needs to use inside say @Column( …, table=“SomeEntity1”) is the name that
>> comes out of the implicit naming contract (assuming the original table was
>> implicit). Is that correct?
>>
>
> This is true.  But remember that this is mainly intended to signify a
> secondary table, whose name cannot be implicit.  Also, I think that mixing
> implicit naming and explicit naming and expecting that to work is not
> necessarily a valid expectation.
>

I just wanted to clarify here a bit.  As far as I know, the only time that
this could be a problem is when we need @Column to refer to the primary
table and the name of the primary table is implicit.  But JPA designs for
that by saying that @Column is expected to refer to the primary table when
@Column#table is null or not specified.  What I was saying above was this,
imo, it is not a reasonable for this to work:

@Entity
public Customer {
    @Column( ..., table="Customer" )
    ...
}

I just think that makes no sense.

Am I missing any potential uses where @Column#table would refer to
something that might reasonably be implicit?


More information about the hibernate-dev mailing list