Hi !
I use an entity name to retrieve a PersistentClass. Thanks to a given attribute name, I could retrieve a Property from this PersistentClass. This property is mapping a foreign key, so I try to find out the corresponding colum name.
With property.getValue().getColumnIterator(), I get it for an aggregation link @ManyToOne. But the iterator has no element in case of @OneToOne.
For an association, I'm try to find it out by an other way. I use a the Table.getForeignKeyIterator() and with foreignKey.getReferencedEntityName() I check if it is the associated Entity i'm looking for.
I know this is not the right way... How could I find out the column name of a property which is mapping a foreign key ?
I use a Configuration instance to get the Property and PersistentClass.
Thanks !!!
|