Yes, pparking0_ is a valid alias as shown below in the generated SQL
query and AddressId exists in the table also shown below in the create
table script.

select
pcity4_.Name as col_0_0_, pstreet5_.Name as col_1_0_,
pparkingad2_.StreetNumber as
col_2_0_, miejscapos1_.Numer as col_3_0_, miejscapos1_.Opis as
col_4_0_, pparking0_.Opis as
col_5_0_, pparking0_.Name as col_6_0_, miejscapos1_.Id as col_7_0_,
pcategory3_.Name as col_8_0_,
puzytkowni6_.Login as col_9_0_, miejscapos1_.ParkingId as col_10_0_

from
P_Parking pparking0_ inner join P_Miejsce miejscapos1_ on
pparking0_.Id=miejscapos1_.ParkingId
inner join P_Category pcategory3_ on
miejscapos1_.CategoryId=pcategory3_.Id,
P_Uzytkownik puzytkowni6_
inner join P_ParkingAddress pparkingad2_ on
pparking0_.AddressId=pparkingad2_.Id,
P_City pcity4_,
P_Street pstreet5_

where miejscapos1_.UzytkownikId=puzytkowni6_.Id and
pparkingad2_.CityId=pcity4_.Id
and pparkingad2_.StreetId=pstreet5_.Id and
miejscapos1_.UzytkownikId=1

group by pcity4_.Name , pstreet5_.Name , pparkingad2_.StreetNumber ,
miejscapos1_.Numer ,
miejscapos1_.Opis , pparking0_.Opis , pparking0_.Name ,
miejscapos1_.Id , pcategory3_.Name ,
puzytkowni6_.Login , miejscapos1_.ParkingId





CREATE TABLE `p_parking` (
        `Id` INT(11) NOT NULL AUTO_INCREMENT,
        `Sys_CreatedDate` DATETIME NULL DEFAULT NULL,
        `Sys_ModifiedDate` DATETIME NULL DEFAULT NULL,
        `Opis` TEXT NULL,
        `Name` VARCHAR(255) NOT NULL,
        `Garaz` TINYINT(1) NULL DEFAULT NULL,
        `Podziemny` TINYINT(1) NULL DEFAULT NULL,
        `Strzezony` TINYINT(1) NULL DEFAULT NULL,
        `AddressId` INT(11) NULL DEFAULT NULL,
        `WlascicielId` INT(11) NULL DEFAULT NULL,
        PRIMARY KEY (`Id`),
        INDEX `AddressId` (`AddressId`),
        INDEX `WlascicielId` (`WlascicielId`),
        CONSTRAINT `FKC4B51D7EEC38A52B` FOREIGN KEY (`WlascicielId`)
REFERENCES `p_uzytkownik` (`Id`),
        CONSTRAINT `FKC4B51D7E5EBFF014` FOREIGN KEY (`AddressId`) REFERENCES
`p_parkingaddress` (`Id`)
)
ENGINE=InnoDB
ROW_FORMAT=DEFAULT
AUTO_INCREMENT=4

On 4 Lip, 17:21, Mauricio Scheffer <[email protected]> wrote:
> Does pparking0_ exist as a valid alias in the generated query? Does AddressId
> exist as a valid column in that table in your database?
>
> On Sun, Jul 4, 2010 at 12:03 PM, Paweł <[email protected]> wrote:
> > I had a quite old Castle dll files in my project and decided to
> > upgrade them to the newest version.
> > ActiveRecord and NHibernate were among them. When I launched the
> > project some HQL queries
> > run fine but some of them stopped working and threw exception. All
> > exceptions have the same reason. I run the generated SQL query in a
> > MySql client app and it brought up the same error (Unknown column
> > xxxxx in 'on clause'). It's strange because before upgrading the dll
> > files everything worked fine. It seems that nhibernate has changed the
> > way it generates SQL statements from HQL
>
> > Has anyone come across above issue and knows a workaround?
>
> > ActiveRecordException
>
> >        Message:
> >        Could not perform ExecuteQuery for PMiejsce
>
> >                StackTrace:
> > .
> > .
> > .
> > .
>
> >                <b>Inner exception:</b>
> >                        ADOException
>
> >        Message:
> >        could not execute query
> > .
> > .
> > .
> > .
> > <b>Inner exception:</b>
> >                        MySqlException
>
> >        Message:
> >        Unknown column 'pparking0_.AddressId' in 'on clause'
>
> >        StackTrace:
> >           at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
> >   at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32&
> > affectedRow, Int32& insertedId)
> >   at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId,
> > Int32& affectedRows, Int32& insertedId)
> >   at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId)
> >   at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
> >   at
> > MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior
> > behavior)
> >   at
> > MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior
> > behavior)
> >   at
> > System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
> >   at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)
> >   at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean
> > autoDiscoverTypes, Boolean callable, RowSelection selection,
> > ISessionImplementor session)
> >   at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session,
> > QueryParameters queryParameters, Boolean returnProxies)
> >   at
>
> > NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor
> > session, QueryParameters queryParameters, Boolean returnProxies)
> >   at NHibernate.Loader.Loader.DoList(ISessionImplementor session,
> > QueryParameters queryParameters)
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Castle Project Users" group.
> > To post to this group, send email to [email protected]
> > .
> > To unsubscribe from this group, send email to
> > [email protected]<castle-project-users%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/castle-project-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to