hello,
I would like to make the following sql work with Hibernate, but can't seem to get it right...
Code:
select * from ge_outage_component where geo_id in (select geo_id from ge_outage_component group by geo_id having count(*)<2) order by geo_id
my GeOutageComponent class looks like this:
Code:
public class GeOutageComponent implements java.io.Serializable {
private Long id;
private GeOutage geOutage;
private Component component;
// getters and setters...
}
and my hibernate-mapping:
Code:
<hibernate-mapping>
<class name="com.acme.ge.generated.GeOutageComponent" table="GE_OUTAGE_COMPONENT" lazy="false">
<id name="id" type="java.lang.Long" column="ID">
<generator class="sequence">...</generator>
</id>
<many-to-one name="geOutage" class="com.acme.ge.generated.GeOutage" not-null="true">
<column name="GEO_ID" />
</many-to-one>
<many-to-one name="component" class="com.acme.ge.generated.Component" not-null="true">
<column name="CMP_IRN_NR" />
</many-to-one>
</class>
</hibernate-mapping>
I've been struggling with this for a while now, but can't get it to work... Any help would be highly appreciated!