[jboss-jira] [JBoss JIRA] (HIBERNATE-160) Allow PhysicalNamingStrategy implementations to detect when a name is implicit or explicit

Steve Ramage (Jira) issues at jboss.org
Sun Feb 3 23:23:00 EST 2019


    [ https://issues.jboss.org/browse/HIBERNATE-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13690477#comment-13690477 ] 

Steve Ramage commented on HIBERNATE-160:
----------------------------------------

This manifests as a very confusing bug in Spring Boot, the linked issue is a blocker, but I just wasted an hour trying to figure out why the name attribute was being ignored.

> Allow PhysicalNamingStrategy implementations to detect when a name is implicit or explicit
> ------------------------------------------------------------------------------------------
>
>                 Key: HIBERNATE-160
>                 URL: https://issues.jboss.org/browse/HIBERNATE-160
>             Project: Hibernate Integration
>          Issue Type: Feature Request
>            Reporter: Phillip Webb
>            Assignee: Steve Ebersole
>            Priority: Optional
>
> It's possible for column names to be explicitly defined, for example:
> {code:java}
> @Column(name = "firstName")
> private String firstName;
> {code}
> Or deduced implicitly from the name of the field:
> {code:java}
> @Column
> private String firstName;
> {code}
> Both of these forms result in a call to {{PhysicalNamingStrategy}} with an {{Identifier}} but it's not possible to tell if the identified is explicitly named or deduced (the relevant code is [here|https://github.com/hibernate/hibernate-orm/blob/47382f69cc282a3df1bc373300eeeeee5237b81f/hibernate-core/src/main/java/org/hibernate/cfg/Ejb3Column.java#L304] and [here|https://github.com/hibernate/hibernate-orm/blob/47382f69cc282a3df1bc373300eeeeee5237b81f/hibernate-core/src/main/java/org/hibernate/cfg/Ejb3Column.java#L311]).
> It would be nice if the {{Identifier}} could include an additional field that tells us where it came from. This would allow generic naming strategies to be developed that back-off when a {{name}} attribute is defined by the user.
> For more background on users that are asking for this see [this Spring Boot issue|https://github.com/spring-projects/spring-boot/issues/2129].



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the jboss-jira mailing list