Class EDmvIngestor


  • public class EDmvIngestor
    extends Object
    This class provides a _sparse_ example implementation of how one can use the parser to ingest the information from the XML file to populate the database.
    • Constructor Detail

      • EDmvIngestor

        public EDmvIngestor()
    • Method Detail

      • setInputStream

        public void setInputStream​(InputStream is)
      • setPersonDAO

        public void setPersonDAO​(PersonDAO personDAO)
      • setVehicleDAO

        public void setVehicleDAO​(VehicleDAO vehicleDAO)
      • ingest

        public void ingest()
                    throws javax.xml.bind.JAXBException,
                           XMLStreamException,
                           Exception
        This method will ingest the input data by reading in external DTOs in from the parser, instantiating project business objects, and inserting into database. Note that the XML Schema is organized such that object references are fully resolved. Therefore, there is no specific need to process the addresses as they come in. They can be stored once we get the accounts they are related to.
        Throws:
        javax.xml.bind.JAXBException
        XMLStreamException
        DAOException
        Exception
      • createPerson

        private void createPerson​(Person personDTO)
                           throws DAOException
        This method is called by the main ingest processing loop. The JAXB/StAX parser will already have the Person populated with internal property information.
        Parameters:
        personDTO -
        Throws:
        DAOException
      • createRegistration

        private void createRegistration​(VehicleRegistration registrationDTO)
                                 throws Exception
        This method is called by the main ingest processing loop. The JAXB/StAX parser will already have the VehicleRegistration populated with internal property information. The Person information for owners should also already exist.
        Parameters:
        registrationDTO -
        Throws:
        DAOException
        Exception