Hibernate problem with too many subclasses

J

Jacqui

Hi,

I have a model for a webapp which is set up as follows:-

JobService - base class

AirportPickupService - extends JobService
LeaseNegotiationService - extends JobService
..... and so on for 28 services.

These are currently modelled in Hibernate as joined subclasses.

I also have a class 'Job' which has a collection of job services. This
has a method getJobServices().

When I call getJobServices() I are get a MySQL too many tables
exception. I believe this is because Hibernate tries to put all 28
services into a single SQL query. Is there any way of telling
Hibernate to use separate queries for each of the subclasses?

Would changing the system to table-per-concrete-class work? This is a
really ugly way of doing it in our system, as there are many columns in
the JobService class.

I look forward to hearing your reply on this matter. Thanks in
advance.

Regards,
Jacqui
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top