Oh I seriously need help on this and I am stuck, all I am getting is error after error.
First here are the 3 tables in the most minimum.
Advertiser.cfc
property name=“AdvertiserId” generator=“identity” fieldtype=“id”;
property name=“CompanyCode” ormtype=“string” length=“10” fieldtype=“id”;
property name=“AdvertiserTypeId” ormtype=“int”;
property name=“Company” ormtype=“string” length=“70”;
AdvertiserType.cfc
property name=“AdvertiserTypeId” generator=“identity” fieldtype=“id”;
property name=“CompanyCode” ormtype=“string” length=“10” fieldtype=“id”;
property name=“Name” ormtype=“string” length=“50”;
Galerry.cfc
property name=“GalleryId” generator=“identity” fieldtype=“id”;
property name=“CompanyCode” ormtype=“string” length=“10” fieldtype=“id”;
property name=“AdvertiserId” ormtype=“int”;
property name=“Name” ormtype=“string” length=“50”;
And the original query that I am transforming over to HQL
select distinct Advertiser.AdvertiserTypeId, AdvertiserType.Name
from AdvertiserType
inner join Advertiser ON AdvertiserType.AdvertiserTypeId = Advertiser.AdvertiserTypeId
right outer join Gallery ON Advertiser. AdvertiserId = Gallery.AdvertiserId
order by AdvertiserType.Name
So what I have tried to just get going is put a relationship inside the Advertiser.cfc like this
property name=“AdvertiserTypeId” fieldtype=“many-to-one” CFC=“AdvertiserType” fkcolumn=“AdvertiserTypeId,CompanyCode”;
When I right the first bit of HQL which I assume would be this
From AdvertiserType adt inner join adt.AdvertiserTypeId as ad
All I am getting is an exception thrown, which is listed in the previous post below. It seems that I am not understanding the relationships here, and as this is an existing DB with data I am just trying to map to it and get a result based on the same as a normal query.
Anyone have any ideas?