kundera icon indicating copy to clipboard operation
kundera copied to clipboard

Using image blob in native queries (Cassandra)

Open sohelmk opened this issue 6 years ago • 2 comments

Hi, I am unable to insert image (byte array in scala) into a blob column in cassandra. Please help or let me know if its a limitation and if any other options.

Thanks, Sohel

sohelmk avatar Nov 24 '18 15:11 sohelmk

Check ByteDataTest.java

devender-yadav avatar Nov 26 '18 09:11 devender-yadav

Thanks a lot Devender, but these examples are not for native queries. Can you please redirect to an example with native query?

for eg : code looks as follows: var cql = "UPDATE groups SET created_by = " + grup.creator + ",access_type='" + grup.gtype + "',labels=" + grup.getLabelString() + ",updated_timestamp='" + grup.utime + "', created_timestamp='" + grup.ctime + "',updated_by=" + grup.updator + ", description='" + grup.descr + "',group_account='" + grup.grouAccount + "',group_name='" + grup.gname + "' WHERE group_id=" + grup.gid logger.debug("Update Group native cql" + cql)

  var query = em.createNativeQuery(cql).executeUpdate()

How do i add byte array in above query?

Thanks, Sohel

sohelmk avatar Nov 28 '18 12:11 sohelmk