Allow duplicate table mapping for creating DTO's

Description

To create DTO's (lighter object, that don't map the whole table/jointable of an object) it should be possible to map multiple entities to the same table.
This would be a very convenient way to create DTO's!

Right now it's not possible to create a schema like this due to the following exception:

Caused by: org.hibernate.DuplicateMappingException: Duplicate table mapping SubClass1

Could this become a warning instead of an exeception?
Or a @IgnoreDuplicateTableMapping annotation of some sort?

See also the following stackoverflow issue that goes into more detail:
http://stackoverflow.com/questions/30071394/data-transfer-object-dto-hibernate-duplicate-table-mapping

Environment

None

Activity

Show:
Christian Beikov
February 16, 2016, 11:49 AM

If read-only access to your DTOs is enough for you, take a look at blaze-persistence. Write-support is currently under development.

Chris Cranford
March 26, 2016, 6:45 PM

There are also two other read-only alternatives.

The HQL/JPQL new operator:

The JPA construct API:

Assignee

Unassigned

Reporter

Mark Nuyts

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

Affirmative

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure