xenoterracide
03/19/2019, 8:15 PMinterface InserterPacket100hz {
fun myInsertAll(list: Collection<Packet100hz> )
}
interface Packet100hzRepo: CrudRepository<Packet100hz, RFID>, InserterPacket100hz
@Repository
internal class Packet100HzInsertImpl(private val jdbc: JdbcTemplate): InserterPacket100hz {
override fun myInsertAll(list: Collection<Packet100hz>) {
var sql = "INSERT INTO packet_100hz_secure (rfid, pressure_signal, uo_pressure, chamber_pressure, ultrasonic_signal, \"timestamp\") VALUES "
for (packet100hz in list) {
// 6 cols
sql += "(?, ?, ?, ?, ?, ?)\n" // maybe should use string builder
}
val inserts = list.flatMap {
listOf(
it.rfid.rfid,
it.pressureSignal,
it.uoPressure,
it.chamberPressure,
it.ultrasonicSignal,
it.rfid.timestamp
)
}.toTypedArray()
jdbc.update( sql, inserts )
}
}
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property myInsertAll found for type Packet100hz!
… well no duh spring… trying to do a custom repository implementation, anyone know what I’m doing wrong?tjb
03/19/2019, 8:28 PMinterface Packet100hzRepo: CrudRepository<Packet100hz, RFID>, InserterPacket100hz
shouldnt this have the @Repository
annotation?tjb
03/19/2019, 8:29 PM@Component
annotation 🤔xenoterracide
03/19/2019, 8:29 PMtjb
03/19/2019, 8:30 PMtjb
03/19/2019, 8:30 PMtjb
03/19/2019, 8:30 PMtjb
03/19/2019, 8:30 PMinterface InserterPacket100hz {
fun myInsertAll(list: Collection<Packet100hz> )
}
@Repository
interface Packet100hzRepo: CrudRepository<Packet100hz, RFID>, InserterPacket100hz
internal class Packet100HzInsertImpl(private val jdbc: JdbcTemplate): InserterPacket100hz {
override fun myInsertAll(list: Collection<Packet100hz>) {
var sql = "INSERT INTO packet_100hz_secure (rfid, pressure_signal, uo_pressure, chamber_pressure, ultrasonic_signal, \"timestamp\") VALUES "
for (packet100hz in list) {
// 6 cols
sql += "(?, ?, ?, ?, ?, ?)\n" // maybe should use string builder
}
val inserts = list.flatMap {
listOf(
it.rfid.rfid,
it.pressureSignal,
it.uoPressure,
it.chamberPressure,
it.ultrasonicSignal,
it.rfid.timestamp
)
}.toTypedArray()
jdbc.update( sql, inserts )
}
}
tjb
03/19/2019, 8:31 PMtjb
03/19/2019, 8:32 PMinternal
keyword…but i am not 100% sure on that onexenoterracide
03/19/2019, 8:33 PMxenoterracide
03/19/2019, 8:33 PMxenoterracide
03/19/2019, 8:39 PMxenoterracide
03/19/2019, 8:39 PMcorneil
03/22/2019, 2:40 PMxenoterracide
03/22/2019, 4:22 PMcorneil
03/22/2019, 4:24 PM