Message from discussion
Problems using the i18n Behaviour with schemas in PostgreSQL
MIME-Version: 1.0
Received: by 10.100.132.4 with SMTP id f4mr1429898and.13.1245703249901; Mon,
22 Jun 2009 13:40:49 -0700 (PDT)
Date: Mon, 22 Jun 2009 13:40:49 -0700 (PDT)
In-Reply-To: <b7108a3c-e78e-4686-af82-bbb5276d3c3d@h11g2000yqb.googlegroups.com>
X-IP: 189.58.133.72
References: <b7108a3c-e78e-4686-af82-bbb5276d3c3d@h11g2000yqb.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.11)
Gecko/2009060309 Ubuntu/9.04 (jaunty) Firefox/3.0.11,gzip(gfe),gzip(gfe)
Message-ID: <a7d1dd66-a141-4bf5-aa57-db694310b6f6@e21g2000yqb.googlegroups.com>
Subject: Re: Problems using the i18n Behaviour with schemas in PostgreSQL
From: Nei Rauni Santos <nra...@gmail.com>
To: doctrine-dev <doctrine-dev@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
The error is:
Couldn't hydrate. Found non-unique key mapping named 'lang'.
On 22 jun, 17:39, Nei Rauni Santos <nra...@gmail.com> wrote:
> Guys,
>
> I'm having problems with innerJoins with i18n tables, the doctrine not
> putting the schema name in front table names..
>
> my query is:
>
> =A0//busca as amenidades do hotel
> =A0 =A0 $q =3D new Doctrine_Query();
> =A0 =A0 $q->from('HotelFacility hf')
> =A0 =A0 =A0 ->innerJoin('hf.HotelFacilityType hft')
> =A0 =A0 =A0 ->innerJoin('hf.FacilityType ft')
> =A0 =A0 =A0# ->innerJoin('hft.Translation hft8')
> =A0 =A0 =A0# ->innerJoin('ft.Translation fttran')
> =A0 =A0 =A0 ->where('hf.hotel_id =3D ? and hf.value IS TRUE ', $this->id =
);
>
> It's generating the sql:
>
> SELECT
> b.hotel_facility_type_id AS b__hotel_facility_type_id,
> b.hotel_id AS b__hotel_id, b.facility_type_id AS b__facility_type_id,
> b.value AS b__value, b2.id AS b2__id, b2.facility_type_id AS
> b2__facility_type_id,
> b2.type AS b2__type, b3.id AS b3__id
> FROM booking.hotel_facility b
> INNER JOIN booking.hotel_facility_type b2 ON b.hotel_facility_type_id
> =3D b2.id
> INNER JOIN booking.facility_type b3 ON b.facility_type_id =3D b3.id
> WHERE (b.hotel_id =3D ? AND b.value IS TRUE)
>
> but if I uncomment the innerJoin of translation tables, the table no
> include the booking ( schema )
>
> SELECT
> b.hotel_facility_type_id AS b__hotel_facility_type_id, b.hotel_id AS
> b__hotel_id, b.facility_type_id AS b__facility_type_id, b.value AS
> b__value,
> b2.id AS b2__id, b2.facility_type_id AS b2__facility_type_id, b2.type
> AS b2__type, b3.id AS b3__id,
> h.id AS h__id, h.name AS h__name, h.created_at AS h__created_at,
> h.updated_at AS h__updated_at,
> h.lang AS h__lang, f.id AS f__id, f.name AS f__name, f.created_at AS
> f__created_at,
> f.updated_at AS f__updated_at, f.lang AS f__lang
> FROM booking.hotel_facility b
> INNER JOIN booking.hotel_facility_type b2 ON b.hotel_facility_type_id
> =3D b2.id
> INNER JOIN booking.facility_type b3 ON b.facility_type_id =3D b3.id
> INNER JOIN hotel_facility_type_translation h ON b2.id =3D h.id ---- NOT
> USING SCHEMA
> INNER JOIN facility_type_translation f ON b3.id =3D f.id =A0---- NOT USIN=
G
> SCHEMA
> WHERE (b.hotel_id =3D ? AND b.value IS TRUE)
>
> Is it a bug??
>
> HotelFacilityType:
> =A0 tableName: booking.hotel_facility_type
> =A0 actAs:
> =A0 =A0 Timestampable: ~
> =A0 =A0 I18n:
> =A0 =A0 =A0 fields: [name, created_at, updated_at]
> ......
>
> FacilityType:
> =A0 tableName: booking.facility_type
> =A0 actAs:
> =A0 =A0 Timestampable: ~
> =A0 =A0 I18n:
> =A0 =A0 =A0 fields: [name, created_at, updated_at]