Class DefaultDataRepresentationService

    • Constructor Detail

      • DefaultDataRepresentationService

        public DefaultDataRepresentationService()
    • Method Detail

      • toInternalRepresentation

        public <T> byte[] toInternalRepresentation​(T dataObject)
        Description copied from interface: DataRepresentationService
        Convert the given dataObject into something which can be stored in a BLOB in the database.
        Specified by:
        toInternalRepresentation in interface DataRepresentationService
        Parameters:
        dataObject - the object to store or null if no data is to be stored
        Returns:
        the internal representation of the dataObject
      • toJavaRepresentation

        public <T> T toJavaRepresentation​(byte[] internalRepresentation)
        Description copied from interface: DataRepresentationService
        Convert the internal representation stored in the PersistenceManagerService to the Java objects needed by the batch artifacts.
        Specified by:
        toJavaRepresentation in interface DataRepresentationService
        Parameters:
        internalRepresentation - the String representation which we store in the databas
        Returns:
        the dataObject
      • convertCustomTypes

        protected <T> byte[] convertCustomTypes​(T dataObject)
        This is an extension point for other serialisation algorithms.
      • convertJavaNativeTypes

        protected <T> byte[] convertJavaNativeTypes​(T dataObject)
        This method converts java native types to a 'nice' string representation which will be stored in the database.
        Returns:
        the String representation or null if the dataObject was not a native Java type
      • convertBackJavaNativeTypes

        protected <T> T convertBackJavaNativeTypes​(String typeVal,
                                                   String value)
      • convertJava7DateTypes

        protected <T> byte[] convertJava7DateTypes​(T dataObject)
        Convert javas internal Date objects to db representation. The converted types are:
        • java.util.Date
        • java.sql.Date
        • java.sql.Timestamp
      • convertBackJava7DateTypes

        protected <T> T convertBackJava7DateTypes​(String typeVal,
                                                  String valueVal)
      • convertSerializableObjectTypes

        protected <T> byte[] convertSerializableObjectTypes​(T dataObject)
        This is the default operation if no other way to serialise the data was used
      • convertBackSerializableObjectTypes

        protected <T> T convertBackSerializableObjectTypes​(byte[] internalRepresentation)
      • toBatchEeData

        protected byte[] toBatchEeData​(Class<?> type,
                                       String stringRepresentation)
      • getClassLoader

        protected ClassLoader getClassLoader()
      • getTimestampDateFormat

        protected SimpleDateFormat getTimestampDateFormat()
        Attention: The nanos must get concatenated separately as there is no formatter for nanos!