2015-01-14 16:06 GMT+01:00 Steve Ebersole <steve(a)hibernate.org>:
> So I also propose to shift this to use that Identifier class
>
> I like that idea.
>
> Is it correct to say it represents a logical name basically? If so, how
> about naming it "LogicalName"? "Identifier" seems too generic to
me (e.g.
> easily to be mixed up with entity identifiers). Would that class/interface
> define a method String getPhysicalName()? That should nicely encapsulate
> the quote handling.
>
Well that depends on how we interpret "logical name". Take a table named
"my_table" in the "my_schema" schema as part of the
"my_catalog" catalog.
Now, each of those individual "names" would be an
* tableName = new Identifier( "my_table", false );
* schemaName = new Identifier( "my_schema", false );
* catalogName = new Identifier( "my_catalog", false );
So Identifier really just represents the parts of a "object name" (in SQL
terms).
Now historically, the logical name of a table is represented by this
qualified form. Remember though that "historically" points specifically to
growing from hbm.xml mapping where this is not really an issue.
As an aside, in that metamodel branch there is also an aggregated form to
represent the qualified table name by composing all 3 components together,
as well as physically grouping them into Schema objects. But there is no
natural corollary to these concepts in org.hibernate.mapping, and so I will
not pull them over. Although... I will say that it might be better to use
that typed form (QualifiedTableName class aggregating the 3 compoment
names) as the "cross reference key".
Yes, such an aggregated form indeed is how I had done it on first thought.
But then I don't really know the code which would be using it, so I cannot
comment on whether that'd be feasible or doable at this point of time.