Search in sources :

Example 1 with ChargeBoxRecord

use of jooq.steve.db.tables.records.ChargeBoxRecord in project steve by RWTH-i5-IDSG.

the class ChargePointRepositoryImpl method getDetails.

@Override
public ChargePoint.Details getDetails(int chargeBoxPk) {
    ChargeBoxRecord cbr = ctx.selectFrom(CHARGE_BOX).where(CHARGE_BOX.CHARGE_BOX_PK.equal(chargeBoxPk)).fetchOne();
    if (cbr == null) {
        throw new SteveException("Charge point not found");
    }
    AddressRecord ar = addressRepository.get(ctx, cbr.getAddressPk());
    return new ChargePoint.Details(cbr, ar);
}
Also used : AddressRecord(jooq.steve.db.tables.records.AddressRecord) ChargeBoxRecord(jooq.steve.db.tables.records.ChargeBoxRecord) SteveException(de.rwth.idsg.steve.SteveException)

Aggregations

SteveException (de.rwth.idsg.steve.SteveException)1 AddressRecord (jooq.steve.db.tables.records.AddressRecord)1 ChargeBoxRecord (jooq.steve.db.tables.records.ChargeBoxRecord)1