May be I did not explain the task: I have to save in IRIS exact 8 bytes.

For example:

byte[] bytes = {35, -14, 119, -4, -114, -59, 35, 14};
String salt = Base64.getEncoder().encodeToString(bytes);
The salt is "I/J3/I7FIw4=", its length is 12.

Do you mean that if I save "I/J3/I7FIw4=" through JPA, I'll get in IRIS exact 8 bytes {35, -14, 119, -4, -114, -59, 35, 14}?

I've just tried it on, It seams it does not work: SQLCODE: <-105>

P.S. The only way I've found for now is plain JDBC and setBinaryStream() method.

Good Evening!

Thanks for this example!

But, how should I annotate field in my Java Entity class to work with fields like:

Property Salt As %Binary(MAXLEN = 8);

If I use String I get wrong bytes.

If I use Byte[] I can read records properly, but when I try to save data to IRIS I get this error:

Caused by: java.sql.SQLException: Unsupported type conversion of Byte Array 
    at com.intersystems.jdbc.IRISPreparedStatement.checkDataType(IRISPreparedStatement.java:251)
    at com.intersystems.jdbc.IRISPreparedStatement.writePSUpdateParameters(IRISPreparedStatement.java:207)
    at com.intersystems.jdbc.IRISPreparedStatement.Update(IRISPreparedStatement.java:153)
    at com.intersystems.jdbc.IRISPreparedStatement.executeUpdate(IRISPreparedStatement.java:109)
    at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
    at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197)