Skip to content

Commit

Permalink
Quem fez a maior parte foi Edson
Browse files Browse the repository at this point in the history
  • Loading branch information
Humeid-Ussene-Jocordasse committed Sep 25, 2019
1 parent f3a4dc9 commit 791583e
Show file tree
Hide file tree
Showing 20 changed files with 434 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*.zip
*.tar.gz
*.rar
*.xml
*.mf

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
Empty file.
Empty file.
14 changes: 14 additions & 0 deletions build/classes/META-INF/persistence.xml
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>
56 changes: 56 additions & 0 deletions build/classes/hibernate.cfg.xml
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>
57 changes: 57 additions & 0 deletions lib/nblibraries.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,60 @@ libs.CopyLibs.classpath=\
${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
libs.CopyLibs.displayName=CopyLibs Task
libs.CopyLibs.prop-version=2.0
libs.hibernate4-persistence.classpath=\
${base}/hibernate4-persistence/antlr-2.7.7.jar;\
${base}/hibernate4-persistence/c3p0-0.9.2.1.jar;\
${base}/hibernate4-persistence/hibernate-c3p0-4.3.1.Final.jar;\
${base}/hibernate4-persistence/mchange-commons-java-0.2.3.4.jar;\
${base}/hibernate4-persistence/dom4j-1.6.1.jar;\
${base}/hibernate4-persistence/ehcache-core-2.4.3.jar;\
${base}/hibernate4-persistence/hibernate-ehcache-4.3.1.Final.jar;\
${base}/hibernate4-persistence/hibernate-core-4.3.1.Final.jar;\
${base}/hibernate4-persistence/jboss-logging-3.1.3.GA.jar;\
${base}/hibernate4-persistence/hibernate-commons-annotations-4.0.4.Final.jar;\
${base}/hibernate4-persistence/hibernate-entitymanager-4.3.1.Final.jar;\
${base}/hibernate4-persistence/javassist-3.18.1-GA.jar;\
${base}/hibernate4-persistence/jboss-transaction-api_1.2_spec-1.0.0.Final.jar;\
${base}/hibernate4-persistence/slf4j-api-1.6.1.jar;\
${base}/hibernate4-persistence/slf4j-simple-1.6.1.jar;\
${base}/hibernate4-persistence/hibernate-jpa-2.1-api-1.0.0.Final.jar
libs.hibernate4-persistence.displayName=Hibernate 4.3.x(JPA2.1)
libs.hibernate4-persistence.javadoc=\
${base}/hibernate4-persistence/javax.persistence-2.1.0-doc.zip
libs.hibernate4-persistence.prop-maven-dependencies=\n org.hibernate:hibernate-entitymanager:4.3.1.Final:jar\n
libs.hibernate4-persistencemodelgen.classpath=\
${base}/hibernate4-persistencemodelgen/hibernate-jpamodelgen-4.3.1.Final.jar
libs.hibernate4-persistencemodelgen.displayName=Hibernate 4.3.x Modelgen
libs.hibernate4-persistencemodelgen.prop-maven-dependencies=\n org.hibernate:hibernate-jpamodelgen-4.3.1.Final:jar\n
libs.hibernate4-support.classpath=\
${base}/hibernate4-support/antlr-2.7.7.jar;\
${base}/hibernate4-support/c3p0-0.9.2.1.jar;\
${base}/hibernate4-support/hibernate-c3p0-4.3.1.Final.jar;\
${base}/hibernate4-support/mchange-commons-java-0.2.3.4.jar;\
${base}/hibernate4-support/dom4j-1.6.1.jar;\
${base}/hibernate4-support/ehcache-core-2.4.3.jar;\
${base}/hibernate4-support/hibernate-ehcache-4.3.1.Final.jar;\
${base}/hibernate4-support/hibernate-core-4.3.1.Final.jar;\
${base}/hibernate4-support/jboss-logging-3.1.3.GA.jar;\
${base}/hibernate4-support/hibernate-commons-annotations-4.0.4.Final.jar;\
${base}/hibernate4-support/hibernate-entitymanager-4.3.1.Final.jar;\
${base}/hibernate4-support/javassist-3.18.1-GA.jar;\
${base}/hibernate4-support/jboss-transaction-api_1.2_spec-1.0.0.Final.jar;\
${base}/hibernate4-support/slf4j-api-1.6.1.jar;\
${base}/hibernate4-support/slf4j-simple-1.6.1.jar
libs.hibernate4-support.displayName=Hibernate 4.3.x
libs.hibernate4-support.javadoc=\
${base}/hibernate4-support/javax.persistence-2.1.0-doc.zip
libs.hibernate4-support.prop-maven-dependencies=\n org.hibernate:hibernate-entitymanager:4.3.1.Final:jar\n
libs.JAVADB_DRIVER_LABEL.classpath=\
${base}/JAVADB_DRIVER_LABEL/derby.jar;\
${base}/JAVADB_DRIVER_LABEL/derbyclient.jar;\
${base}/JAVADB_DRIVER_LABEL/derbynet.jar
libs.JAVADB_DRIVER_LABEL.displayName=Java DB Driver
libs.JAVADB_DRIVER_LABEL.prop-maven-dependencies=\norg.apache.derby:derby:10.11.1.1:jar\norg.apache.derby:derbyclient:10.11.1.1:jar\norg.apache.derby:derbynet:10.11.1.1:jar\n
libs.jpa2-persistence.classpath=\
${base}/jpa2-persistence/hibernate-jpa-2.1-api-1.0.0.Final.jar
libs.jpa2-persistence.displayName=Persistence JPA2.1
libs.jpa2-persistence.javadoc=\
${base}/jpa2-persistence/javax.persistence-2.1.0-doc.zip
libs.jpa2-persistence.prop-maven-dependencies=org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final:jar
10 changes: 5 additions & 5 deletions nbproject/build-impl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ is divided into following sections:
- cleanup
-->
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="ProjetoPoo-impl">
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="ProjectoSemestral-impl">
<fail message="Please build using Ant 1.8.0 or higher.">
<condition>
<not>
Expand Down Expand Up @@ -475,7 +475,7 @@ is divided into following sections:
</fileset>
</union>
<taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
<testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="ProjetoPoo" testname="TestNG tests" workingDir="${work.dir}">
<testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="ProjectoSemestral" testname="TestNG tests" workingDir="${work.dir}">
<xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
<propertyset>
<propertyref prefix="test-sys-prop."/>
Expand Down Expand Up @@ -626,7 +626,7 @@ is divided into following sections:
<condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
<isset property="test.method"/>
</condition>
<condition else="-suitename ProjetoPoo -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
<condition else="-suitename ProjectoSemestral -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
<matches pattern=".*\.xml" string="@{testClass}"/>
</condition>
<delete dir="${build.test.results.dir}" quiet="true"/>
Expand Down Expand Up @@ -918,7 +918,7 @@ is divided into following sections:
<delete file="${built-jar.properties}" quiet="true"/>
</target>
<target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
<echo level="warn" message="Cycle detected: ProjetoPoo was already built"/>
<echo level="warn" message="Cycle detected: ProjectoSemestral was already built"/>
</target>
<target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
<mkdir dir="${build.dir}"/>
Expand Down Expand Up @@ -1403,7 +1403,7 @@ is divided into following sections:
<delete file="${built-clean.properties}" quiet="true"/>
</target>
<target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
<echo level="warn" message="Cycle detected: ProjetoPoo was already built"/>
<echo level="warn" message="Cycle detected: ProjectoSemestral was already built"/>
</target>
<target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
<mkdir dir="${build.dir}"/>
Expand Down
8 changes: 4 additions & 4 deletions nbproject/genfiles.properties
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]
3 changes: 2 additions & 1 deletion nbproject/private/private.properties
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
4 changes: 1 addition & 3 deletions nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/C:/Users/Humeid%20Ussene/Desktop/Cadeiras/4%20semestre/POO/POO%202019/ProjectoSemestPoo/src/Model/Funcionario.java</file>
</group>
<group/>
</open-files>
</project-private>
19 changes: 14 additions & 5 deletions nbproject/project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.processor.options=
annotation.processing.processor.options=-Aeclipselink.canonicalmodel.use_static_factory=false
annotation.processing.processors.list=
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
Expand All @@ -24,18 +24,27 @@ debug.test.classpath=\
dist.archive.excludes=
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/ProjetoPoo.jar
dist.jar=${dist.dir}/ProjectoSemestral.jar
dist.javadoc.dir=${dist.dir}/javadoc
excludes=
file.reference.mysql-connector-java-5.1.23-bin.jar=lib/mysql-connector-java-5.1.23-bin.jar
file.reference.mysql-connector-java-5.1.47.jar=lib\\mysql-connector-java-5.1.47.jar
includes=**
jar.compress=false
javac.classpath=
javac.classpath=\
${file.reference.mysql-connector-java-5.1.47.jar}:\
${libs.hibernate4-support.classpath}:\
${libs.JAVADB_DRIVER_LABEL.classpath}:\
${libs.jpa2-persistence.classpath}:\
${libs.hibernate4-persistence.classpath}:\
${file.reference.mysql-connector-java-5.1.23-bin.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.external.vm=true
javac.processorpath=\
${javac.classpath}
${javac.classpath}:\
${libs.hibernate4-persistencemodelgen.classpath}
javac.source=1.8
javac.target=1.8
javac.test.classpath=\
Expand All @@ -54,7 +63,7 @@ javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=projetopoo.ProjetoPoo
main.class=Conex\u00e3o.Conection
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false
Expand Down
2 changes: 1 addition & 1 deletion nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>ProjetoPoo</name>
<name>ProjectoSemestral</name>
<source-roots>
<root id="src.dir"/>
</source-roots>
Expand Down
47 changes: 47 additions & 0 deletions sgcalamidades.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
SQLyog Ultimate v10.00 Beta1
MySQL - 5.7.14 : Database - sgcalamidades
*********************************************************************
*/

/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`sgcalamidades` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `sgcalamidades`;

/*Table structure for table `funcionario` */

DROP TABLE IF EXISTS `funcionario`;

CREATE TABLE `funcionario` (
`DTYPE` varchar(31) NOT NULL,
`id_funcionario` int(11) NOT NULL AUTO_INCREMENT,
`contacto` varchar(255) DEFAULT NULL,
`dataNascimento` datetime DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`estado` bit(1) DEFAULT NULL,
`nome` varchar(255) DEFAULT NULL,
`nrDocumento` varchar(255) DEFAULT NULL,
`sexo` varchar(255) DEFAULT NULL,
`tipoDeDocumento` varchar(255) DEFAULT NULL,
`idCentro` varchar(255) DEFAULT NULL,
`senha` varchar(255) DEFAULT NULL,
`usuario` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id_funcionario`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

/*Data for the table `funcionario` */

insert into `funcionario`(`DTYPE`,`id_funcionario`,`contacto`,`dataNascimento`,`email`,`estado`,`nome`,`nrDocumento`,`sexo`,`tipoDeDocumento`,`idCentro`,`senha`,`usuario`) values ('Operador',4,NULL,NULL,NULL,'\0','Humei Jocordasse',NULL,'Masculino',NULL,NULL,NULL,NULL),('Operador',3,NULL,NULL,NULL,'\0','Humei Jocordasse Kazembe',NULL,'Masculino',NULL,NULL,NULL,NULL);

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
Expand Down
36 changes: 36 additions & 0 deletions src/Arquivo/NewHibernateUtil.java
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;
}
}
Loading

0 comments on commit 791583e

Please sign in to comment.