Class TorqueModelOutput


  • public class TorqueModelOutput
    extends java.lang.Object
    Map InterMine metadata to a Torque database schema in InterMine format
    Author:
    Andrew Varley, Matthew Wakeling
    • Field Detail

      • FORMAT_VERSION

        public static final int FORMAT_VERSION
        The version number of the database format
        See Also:
        Constant Field Values
      • ENDL

        protected static final java.lang.String ENDL
      • file

        protected java.io.File file
      • className

        protected java.lang.String className
    • Constructor Detail

      • TorqueModelOutput

        public TorqueModelOutput​(DatabaseSchema schema,
                                 java.io.File file)
        Constructor for this class
        Parameters:
        schema - a DatabaseSchema
        file - the file to which the torque data should be written
    • Method Detail

      • process

        public void process()
        Process the schema and put the output in the file.
      • generate

        protected java.lang.String generate()
                                     throws ObjectStoreException
        Generate a string that contains the torque data for the given schema.
        Returns:
        a String containing torque data
        Throws:
        ObjectStoreException - if the schema is invalid
      • generateIndirectionTable

        protected java.lang.String generateIndirectionTable​(CollectionDescriptor col)
        Generate an indirection table
        Parameters:
        col - the CollectionDescriptor to generate table for
        Returns:
        a String representing the schema for the indirection table
      • generateJdbcType

        public static java.lang.String generateJdbcType​(java.lang.String type)
        Convert java primitive and object names to those compatible with torque. Returns unaltered string if no conversion is required.
        Parameters:
        type - the string to convert
        Returns:
        torque compatible name