-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3a4dc9
commit 791583e
Showing
20 changed files
with
434 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> | ||
<persistence-unit name="DefesaPOOPU" transaction-type="RESOURCE_LOCAL"> | ||
<provider>org.hibernate.ejb.HibernatePersistence</provider> | ||
<properties> | ||
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/edson?zeroDateTimeBehavior=convertToNull"/> | ||
<property name="javax.persistence.jdbc.user" value="root"/> | ||
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/> | ||
<property name="javax.persistence.jdbc.password" value=""/> | ||
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider"/> | ||
<property name="javax.persistence.schema-generation.database.action" value="create"/> | ||
</properties> | ||
</persistence-unit> | ||
</persistence> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> | ||
<!-- | ||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | ||
Copyright (c) 2008, 2016 Oracle and/or its affiliates. All rights reserved. | ||
Oracle and Java are registered trademarks of Oracle and/or its affiliates. | ||
Other names may be trademarks of their respective owners. | ||
The contents of this file are subject to the terms of either the GNU | ||
General Public License Version 2 only ("GPL") or the Common | ||
Development and Distribution License("CDDL") (collectively, the | ||
"License"). You may not use this file except in compliance with the | ||
License. You can obtain a copy of the License at | ||
http://www.netbeans.org/cddl-gplv2.html | ||
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the | ||
specific language governing permissions and limitations under the | ||
License. When distributing the software, include this License Header | ||
Notice in each file and include the License file at | ||
nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this | ||
particular file as subject to the "Classpath" exception as provided | ||
by Oracle in the GPL Version 2 section of the License file that | ||
accompanied this code. If applicable, add the following below the | ||
License Header, with the fields enclosed by brackets [] replaced by | ||
your own identifying information: | ||
"Portions Copyrighted [year] [name of copyright owner]" | ||
If you wish your version of this file to be governed by only the CDDL | ||
or only the GPL Version 2, indicate your decision by adding | ||
"[Contributor] elects to include this software in this distribution | ||
under the [CDDL or GPL Version 2] license." If you do not indicate a | ||
single choice of license, a recipient has the option to distribute | ||
your version of this file under either the CDDL, the GPL Version 2 or | ||
to extend the choice of license to its licensees as provided above. | ||
However, if you add GPL Version 2 code and therefore, elected the GPL | ||
Version 2 license, then the option applies only if the new code is | ||
made subject to such option by the copyright holder. | ||
Contributor(s): | ||
--> | ||
<hibernate-configuration> | ||
<session-factory> | ||
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> | ||
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> | ||
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/sgcalamidades?zeroDateTimeBehavior=convertToNull</property> | ||
<property name="hibernate.connection.username">root</property> | ||
<property name="hibernate.hbm2ddl.auto">update</property> | ||
<property name="hibernate.show_sql">true</property> | ||
<property name="hibernate.format_sql">true</property> | ||
<mapping class="Model.Funcionario"/> | ||
<mapping class="Model.Operador"/> | ||
<mapping class="Model.Gestor"/> | ||
<mapping class="Model.Administrador"/> | ||
</session-factory> | ||
</hibernate-configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
build.xml.data.CRC32=b93c3ca9 | ||
build.xml.script.CRC32=5ac61e61 | ||
build.xml.data.CRC32=00d123d9 | ||
build.xml.script.CRC32=1d244edd | ||
build.xml.stylesheet.CRC32=[email protected] | ||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. | ||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. | ||
nbproject/build-impl.xml.data.CRC32=b93c3ca9 | ||
nbproject/build-impl.xml.script.CRC32=16c7fbbd | ||
nbproject/build-impl.xml.data.CRC32=00d123d9 | ||
nbproject/build-impl.xml.script.CRC32=b07f15fa | ||
nbproject/build-impl.xml.stylesheet.CRC32=[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
user.properties.file=C:\\Users\\Humeid Ussene\\AppData\\Roaming\\NetBeans\\8.2\\build.properties | ||
compile.on.save=true | ||
user.properties.file=C:\\Users\\Edson Nhancale\\AppData\\Roaming\\NetBeans\\8.2\\build.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package Arquivo; | ||
|
||
import org.hibernate.cfg.AnnotationConfiguration; | ||
import org.hibernate.SessionFactory; | ||
|
||
/** | ||
* Hibernate Utility class with a convenient method to get Session Factory | ||
* object. | ||
* | ||
* @author Edson Nhancale | ||
*/ | ||
public class NewHibernateUtil { | ||
|
||
private static final SessionFactory sessionFactory; | ||
|
||
static { | ||
try { | ||
// Create the SessionFactory from standard (hibernate.cfg.xml) | ||
// config file. | ||
sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory(); | ||
} catch (Throwable ex) { | ||
// Log the exception. | ||
System.err.println("Initial SessionFactory creation failed." + ex); | ||
throw new ExceptionInInitializerError(ex); | ||
} | ||
} | ||
|
||
public static SessionFactory getSessionFactory() { | ||
return sessionFactory; | ||
} | ||
} |
Oops, something went wrong.