Package org.hibernate.cfg

Examples of org.hibernate.cfg.Configuration.addDocument()


        sessionFactoryElement.addElement("property").addAttribute("name", "hibernate.hbm2ddl.auto").setText(hbm2ddlMode);
        // setup config
        Configuration cfg = new Configuration().configure(new DOMWriter().write(document));
        // add object mappings
        Logger.log(mappingDocument.asXML());
        cfg.addDocument(new DOMWriter().write(mappingDocument));
        sessionFactory = cfg.buildSessionFactory();
      } catch (Exception e) {
        Logger.log(e);
      }
    }
View Full Code Here


                                    public InputSource resolveEntity(String arg0, String arg1) throws SAXException, IOException {
                                        return new InputSource(new StringReader(""));
                                    }
                                });
                                Document document = documentBuilder.parse(resources[i].getInputStream());
                                config.addDocument(document);
                            } catch (SAXException e) {
                                throw new DatabaseException("Error reading document " + resources[i].getURL(), e);
                            }
                        }
                    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.