2121import java .util .UUID ;
2222
2323import org .energyos .espi .common .domain .ElectricPowerQualitySummary ;
24+ import org .energyos .espi .common .domain .ElectricPowerUsageSummary ;
2425import org .energyos .espi .common .domain .UsagePoint ;
2526import org .energyos .espi .common .models .atom .EntryType ;
2627import org .energyos .espi .common .repositories .ElectricPowerQualitySummaryRepository ;
@@ -96,7 +97,14 @@ public EntryType findEntryType(Long retailCustomerId, Long usagePointId,
9697 try {
9798 // TODO - this is sub-optimal (but defers the need to understand creation of an EntryType
9899 List <Long > temp = new ArrayList <Long >();
99- temp .add (electricPowerQualitySummaryId );
100+ temp = resourceService .findAllIdsByXPath (retailCustomerId , usagePointId , ElectricPowerUsageSummary .class );
101+ // temp.add(electricPowerQualitySummaryId);
102+ if (temp .contains (electricPowerQualitySummaryId )) {
103+ temp .clear ();
104+ temp .add (electricPowerQualitySummaryId );
105+ } else {
106+ temp .clear ();
107+ }
100108 result = (new EntryTypeIterator (resourceService , temp , ElectricPowerQualitySummary .class )).nextEntry (ElectricPowerQualitySummary .class );
101109 } catch (Exception e ) {
102110 // TODO need a log file entry as we are going to return a null if
@@ -112,7 +120,9 @@ public EntryTypeIterator findEntryTypeIterator(Long retailCustomerId, Long usage
112120 try {
113121 // TODO - this is sub-optimal (but defers the need to understand creation of an EntryType
114122 List <Long > temp = new ArrayList <Long >();
115- temp = resourceService .findAllIds (ElectricPowerQualitySummary .class );
123+ // temp = resourceService.findAllIds(ElectricPowerQualitySummary.class);
124+ temp = resourceService .findAllIdsByXPath (retailCustomerId , usagePointId , ElectricPowerQualitySummary .class );
125+
116126 result = (new EntryTypeIterator (resourceService , temp , ElectricPowerQualitySummary .class ));
117127 } catch (Exception e ) {
118128 // TODO need a log file entry as we are going to return a null if
0 commit comments