-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Maximum number of prefixes error?
PostPosted: Fri Oct 01, 2004 10:33 am 
Beginner
Beginner

Joined: Tue Jan 27, 2004 8:25 am
Posts: 45
Hi all!

I'm having this error while quering some data in my database:



Code:

Hibernate: select hotelreser0_.code as x0_0_ from HotelReservation hotelreser0_ inner join Reservation hotelreser0__1_ on hotelreser0_.code=hotelreser0__1_.code where ((hotelreser0__1_.reportCode<>0 ))and((hotelreser0__1_.controlReservation=es.parsec.parsys.reservation.HotelReservation@1eae719 )) order by  hotelreser0__1_.creationDate descending
2242547 [http-8080-Processor25] WARN  net.sf.hibernate.util.JDBCExceptionReporter  - SQL Error: 117, SQLState: 01000
2242563 [http-8080-Processor25] ERROR net.sf.hibernate.util.JDBCExceptionReporter  - The number name 'es.parsec.parsys.reservation' contains more than the maximum number of prefixes. The maximum is 3.
2242578 [http-8080-Processor25] WARN  net.sf.hibernate.util.JDBCExceptionReporter  - SQL Error: 117, SQLState: 01000
2242594 [http-8080-Processor25] ERROR net.sf.hibernate.util.JDBCExceptionReporter  - The number name 'es.parsec.parsys.reservation' contains more than the maximum number of prefixes. The maximum is 3.
2242594 [http-8080-Processor25] ERROR net.sf.hibernate.util.JDBCExceptionReporter  - Could not execute query
java.sql.SQLException: The number name 'es.parsec.parsys.reservation' contains more than the maximum number of prefixes. The maximum is 3.



Here is what I'm trying to do:
Code:

Iterator it = HibernateSession.currentSession().iterate("from HotelReservation as hr where (hr.reportCode = 0) and (hr.isReplacedByReservation is null) and (hr.confirmationStatus not like 'RQ')");
           
           
            while(it.hasNext())
            {
                HotelReservation res = (HotelReservation)it.next();
                             Iterator auxIt = HibernateSession.currentSession().iterate("from HotelReservation as hra where (hra.reportCode <> 0) and (hra.controlReservation = " + res.getControlReservation() + ") order by hra.creationDate descending");
.
.
.
.
.
            }


Is in the second iterate() where I get the error....
does anybody knows why do I get this error, or what does it means?
Thank you very much in advance for any response!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 04, 2004 3:35 am 
Beginner
Beginner

Joined: Tue Jan 27, 2004 8:25 am
Posts: 45
Can anyone help me please?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 04, 2004 5:03 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
rename you table wo using dots

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 04, 2004 5:57 am 
Beginner
Beginner

Joined: Tue Jan 27, 2004 8:25 am
Posts: 45
emmanuel wrote:
rename you table wo using dots


Hi Emmanuel, thanks for your response! I don't really undertand what do you mean "without using dots"... here is my mapping:
Code:

<class name="es.parsec.parsys.reservation.Reservation">
   <cache usage="read-write" />
   <id name="code" type="long" column="code" unsaved-value="null">
      <generator class="native"/>
   </id>
   <!--many-to-one name="travelFileHeader" class="es.parsec.parsys.travelfile.TravelFileHeader" column="travelFileHeader"/-->
   <many-to-one name="travelFileHeader" class="es.parsec.parsys.travelfile.TravelFileHeader" column="travelFileHeader"/>
   <property name="reference" type="string" length="50"/>
   <property name="leadPaxName" type="string"/>
   <many-to-one name="service" class="es.parsec.parsys.service.Service" column="service"/>
   <property name="creationDate" type="calendar"/>
   <property name="startDate" type="calendar_date"/>
   <property name="endDate" type="calendar_date"/>
   <many-to-one name="controlReservation" class="es.parsec.parsys.reservation.Reservation" column="controlReservation"/>
   <many-to-one name="replacesReservation" class="es.parsec.parsys.reservation.Reservation" column="replacesReservation"/>
   <many-to-one name="isReplacedByReservation" class="es.parsec.parsys.reservation.Reservation" column="isReplacedByReservation"/>
   <property name="isOnRequest" type="boolean"/>
   <many-to-one name="parsysUser" class="es.parsec.parsys.user.ParsysUser" column="parsysUser"/>
   <property name="confirmationStatus" type="string" length="3"/>
   <many-to-one name="branchOffice" class="es.parsec.parsys.agency.BranchOffice" column="branchOffice"/>   
   <property name="reservationType" type="string"/>
   
   <property name="reportCode" type="long"/>
   
   <set name="comments" inverse="true" lazy="true" order-by="comment" cascade="all">
       <key column="reservation"/>
        <one-to-many class="es.parsec.parsys.reservation.ReservationComment"/>
    </set>
   
   <joined-subclass name="es.parsec.parsys.reservation.HotelReservation" table="HotelReservation">
       <key column="code"/>       
       <set name="reservationRooms" inverse="true" lazy="true" order-by="reservation" cascade="all">
          <key column="reservation"/>
           <one-to-many class="es.parsec.parsys.reservation.ReservationRoom"/>
       </set>   
    </joined-subclass>

.
.
.
.
</class>



HotelReservation is a joined sublcass of reservation, and it's table name is HotelReservation... how should I rename it?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 08, 2004 4:28 am 
Beginner
Beginner

Joined: Tue Jan 27, 2004 8:25 am
Posts: 45
Sorry, table Reservation had no name assigned, I have named it "Reservation", but the same error still occurs... any idea?
Please, help me.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.