[jboss-jira] [JBoss JIRA] (HIBERNATE-160) Allow PhysicalNamingStrategy implementations to detect when a name is implicit or explicit
Phillip Webb (JIRA)
issues at jboss.org
Tue Apr 3 19:12:01 EDT 2018
Phillip Webb created HIBERNATE-160:
--------------------------------------
Summary: 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.5.0#75005)
More information about the jboss-jira
mailing list