0

I have a java project that gets data from the CMS, then I put it into a function to retrieve more data and store a piece of that info into an oracle database that has WE8ISO8859P15 (just a non utf-8 charset) as charset.

I found that if I use NCLOB or NVARCHAR2 I can store data in utf-16, the problem is that i have an old version of hibernate (4.1.4final) which doesn't have the tag @Nationalized to implement those two types.

What can I do? Is there a way to bypass the @Nationalized tag or is there another solution which can set the data into the db with no problems (like for example the CONVERT method from oracle)?


Edit:

I have updated hibernate to the version 4.1.10 (first version with @Nationalized), but don't know exactly where to put annotation and which one do i have to put?

BladeITA
  • 31
  • 1
  • 6
  • And you cannot update your version of Hibernate? And you can't store the data in a data store with an appropriate charset? – APC Dec 24 '19 at 10:06
  • Simple answer: It is not possible. Only workaround could be to convert your text to BASE64 and store it, see https://stackoverflow.com/questions/3804279/base64-encoding-and-decoding-in-oracle/3806265#40852152 – Wernfried Domscheit Dec 24 '19 at 10:23
  • Actually i've updated hibernate to 4.1.10 which is the first version with @Nationalized, using `org.hibernate.Version.getVersionString()` i get 4.1.10 but i don't know exactly what to put (and where) the various annotation. Do i only need `@Nationalized @Column(name = "TEMPLATE_EMOJI", nullable = true, columnDefinition = "nclob", length=100000)` ? and do i put this on the declaration of the variable or just above the getTemplateEmoji() method? I want to store the data as it is and not formatting it beacuse others will have to decode it. – BladeITA Dec 24 '19 at 11:13

0 Answers0