Hibernate problem with too many subclasses

Discussion in 'Java' started by Jacqui, Jan 4, 2006.

  1. Jacqui

    Jacqui Guest

    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
     
    Jacqui, Jan 4, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. peelman

    How many threads is too many?

    peelman, Jan 13, 2005, in forum: Java
    Replies:
    12
    Views:
    856
    Esmond Pitt
    Jan 15, 2005
  2. Mirko
    Replies:
    0
    Views:
    2,326
    Mirko
    Oct 12, 2006
  3. Michael Plate

    question to many-to-many of hibernate

    Michael Plate, May 8, 2007, in forum: Java
    Replies:
    0
    Views:
    361
    Michael Plate
    May 8, 2007
  4. Daniel Pitts
    Replies:
    0
    Views:
    509
    Daniel Pitts
    Oct 18, 2007
  5. Dag Sunde
    Replies:
    4
    Views:
    371
Loading...

Share This Page