Custom datatypes for slice-interface-definitions

kdobbkdobb Member Klaus DobblerOrganization: personProject: the project is for the synchronization of files in network with multiple peers

Hi,

I'm using Hibernate at my Java Backend and would like to use the hibernate-generated java-classes for transfer with ice.

Currently, I've defined a struct and then a sequence of this struct in my slice-interface and I'm using it e.g. as return param.

Consequently, I have to map the hibernate-orm-java objects into the ice-generated datatype.

So my question is can i use the already defined java classes as data-type in a slice-definition.?

Regards

Klaus

Best Answer

  • benoitbenoit Rennes, FranceBenoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Accepted Answer

    Hi Klaus,

    If hibernate-orm-java objects implement the java.io.Serializable interface, you should be able to use them directly using the "java:serializable" metadata.

    See https://doc.zeroc.com/display/Ice37/Serializable+Objects+in+Java for more information.

    Keep in mind however that this defeats one of the purpose of Ice: interoperability between different programming languages. You will no longer be able to call on or receive invocations of an Ice program written in another programming language since it won't be able to deserialize it.

    Cheers,

Answers

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Accepted Answer

    Hi Klaus,

    If hibernate-orm-java objects implement the java.io.Serializable interface, you should be able to use them directly using the "java:serializable" metadata.

    See https://doc.zeroc.com/display/Ice37/Serializable+Objects+in+Java for more information.

    Keep in mind however that this defeats one of the purpose of Ice: interoperability between different programming languages. You will no longer be able to call on or receive invocations of an Ice program written in another programming language since it won't be able to deserialize it.

    Cheers,

  • kdobbkdobb Member Klaus DobblerOrganization: personProject: the project is for the synchronization of files in network with multiple peers

    Hi Benoit,

    I didn't think about the interoperability - that's a good point. I'll probably keep it like it is.

    Thanks anyway!

    Regards Klaus

Sign In or Register to comment.