how to persist java.nio.Buffer with javax.persistence ?

V

Vincent Cantin

Hello,

I don't remember seen in any tutorial how to persist Buffers with the
Java Persistence API.

Does somebody know how to do ?
 
D

Danno

Vincent said:
Hello,

I don't remember seen in any tutorial how to persist Buffers with the
Java Persistence API.

Does somebody know how to do ?

You can't, well because Buffers don't implement Serializable. You will
need to flush that Buffer out into something Serializable like an array
and then send that information to session bean or direct to an ejb.

If you still have questions, post away. ;)
 
V

Vincent Cantin

Danno a écrit :
You can't, well because Buffers don't implement Serializable. You will
need to flush that Buffer out into something Serializable like an array
and then send that information to session bean or direct to an ejb.

If you still have questions, post away. ;)

Well, I plan to use a persistence mecanism in a JSE program. Is there
some alternatives to javax.persistence that enable me to persist my data
as easily as it could be ?

I still need to have some kind of entities saved separately but I also
need to have something that can embed my serializable objects like the
classic serialization. Does it exist?
 
D

Danno

Vincent said:
Danno a écrit :

Well, I plan to use a persistence mecanism in a JSE program. Is there
some alternatives to javax.persistence that enable me to persist my data
as easily as it could be ?

I still need to have some kind of entities saved separately but I also
need to have something that can embed my serializable objects like the
classic serialization. Does it exist?

You can still use the java persistence API, but you have to convert
your java.nio.Buffer to and array before doing so. ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top