I am using the latest version of quarkus and hibernate reactive connecting to a postgresql database. Below is my Entity.
@Entity
class Balance: PanacheEntityBase {
@Id
@Convert(converter = EncryptionConverter.class)
@Column(name="encrypted_col", columnDefinition="CLOB")
lateinit var encryptedCol: String
@Column(name="balance")
var balance: Double = 0.0
}
@ApplicationScoped
class BalanceRepository: PanacheRepository<Balance> {
fun findByEncryptedCol(col: String) = find("encryptedCol", col).singleResult()
}
The balance entity is connected to a view on the database. I notice that when I execute this query the converter is not being using and I get a persistence error of no resultset found. This occurs if I send the unencrypted value. If I send the encrypted value then I get back a result.
The expected behaviour should be that the value is encrypted using the converter then pass to the database query. It seems like the converter with Panache doesn't work with database views and only with tables.
Is there another way to do this or a workaround?