Browse Source

principal v2

master
IVAN ALEJANDRO PADILLA CORDOVA 4 months ago
parent
commit
3db1733d22
  1. 68
      Inventario-ejb/build.xml
  2. 131
      Inventario-ejb/nbproject/ant-deploy.xml
  3. 1228
      Inventario-ejb/nbproject/build-impl.xml
  4. 8
      Inventario-ejb/nbproject/genfiles.properties
  5. 76
      Inventario-ejb/nbproject/project.properties
  6. 17
      Inventario-ejb/nbproject/project.xml
  7. 1
      Inventario-ejb/src/conf/MANIFEST.MF
  8. 14
      Inventario-ejb/src/conf/META-INF/glassfish-resources.xml
  9. 8
      Inventario-ejb/src/conf/persistence.xml
  10. 115
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/CategoriaBL.java
  11. 32
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/CategoriaBLLocal.java
  12. 171
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/ColorBL.java
  13. 37
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/ColorBLLocal.java
  14. 101
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/GeneroBL.java
  15. 27
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/GeneroBLLocal.java
  16. 117
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/MarcaBL.java
  17. 30
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/MarcaBLLocal.java
  18. 236
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/ProductosBL.java
  19. 45
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/ProductosBLLocal.java
  20. 132
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/ProveedoresBL.java
  21. 33
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/ProveedoresBLLocal.java
  22. 171
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/RolBL.java
  23. 37
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/RolBLLocal.java
  24. 111
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/TallaBL.java
  25. 30
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/TallaBLLocal.java
  26. 40
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/UbicacionBLLocal.java
  27. 189
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/UbucacionBL.java
  28. 271
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/UsuariosBL.java
  29. 43
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/UsuariosBLLocal.java
  30. 13
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/bl.java
  31. 102
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/CategoriaDAO.java
  32. 96
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/ColorDAO.java
  33. 99
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/GeneroDAO.java
  34. 100
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/MarcaDAO.java
  35. 134
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/ProductosDAO.java
  36. 140
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/ProveedoresDAO.java
  37. 96
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/RolDAO.java
  38. 102
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/TallaDAO.java
  39. 139
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/UbicacionDAO.java
  40. 212
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/UsuariosDAO.java
  41. 125
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Categoria.java
  42. 114
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Color.java
  43. 114
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Genero.java
  44. 114
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Marca.java
  45. 251
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Productos.java
  46. 213
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Proveedores.java
  47. 114
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Rol.java
  48. 114
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Talla.java
  49. 143
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Ubicacion.java
  50. 177
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Usuarios.java
  51. 20
      Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/msg/Mensaje.java
  52. 61
      build.xml
  53. 131
      nbproject/ant-deploy.xml
  54. 635
      nbproject/build-impl.xml
  55. 8
      nbproject/genfiles.properties
  56. 40
      nbproject/project.properties
  57. 39
      nbproject/project.xml
  58. 2
      src/conf/MANIFEST.MF

68
Inventario-ejb/build.xml

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="Inventario-ejb" default="default" basedir="." xmlns:ejbjarproject="http://www.netbeans.org/ns/j2ee-ejbjarproject/3">
<description>Builds, tests, and runs the project Inventario-ejb.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-dist: called before archive building
-post-dist: called after archive building
-post-clean: called after cleaning build products
-pre-run-deploy: called before deploying
-post-run-deploy: called after deploying
(Targets beginning with '-' are not intended to be called on their own.)
Example of pluging an obfuscator after the compilation could look like
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Other way how to customize the build is by overriding existing main targets.
The target of interest are:
init-macrodef-javac: defines macro for javac compilation
init-macrodef-debug: defines macro for class debugging
do-dist: archive building
run: execution of project
javadoc-build: javadoc generation
Example of overriding the target for project execution could look like
<target name="run" depends="<PROJNAME>-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that overridden target depends on jar target and not only on
compile target as regular run target does. Again, for list of available
properties which you can use check the target you are overriding in
nbproject/build-impl.xml file.
-->
</project>

131
Inventario-ejb/nbproject/ant-deploy.xml

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project default="-deploy-ant" basedir=".">
<target name="-init-cl-deployment-env" if="deploy.ant.enabled">
<property file="${deploy.ant.properties.file}" />
<available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/>
<available file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" property="glassfish.web.present"/>
<available file="${deploy.ant.resource.dir}" property="has.setup"/>
<tempfile prefix="gfv3" property="gfv3.password.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<echo message="AS_ADMIN_PASSWORD=${gfv3.password}" file="${gfv3.password.file}"/>
</target>
<target name="-parse-sun-web" depends="-init-cl-deployment-env" if="sun.web.present">
<tempfile prefix="gfv3" property="temp.sun.web" destdir="${java.io.tmpdir}"/>
<copy file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" tofile="${temp.sun.web}"/>
<!-- The doctype triggers resolution which can fail -->
<replace file="${temp.sun.web}">
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken>
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue>
</replace>
<replace file="${temp.sun.web}">
<replacetoken><![CDATA[<sun-web-app]]></replacetoken>
<replacevalue><![CDATA[--> <sun-web-app]]></replacevalue>
</replace>
<xmlproperty file="${temp.sun.web}" validate="false">
</xmlproperty>
<delete file="${temp.sun.web}"/>
<condition property="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}" else="${gfv3.url}/${ant.project.name}">
<isset property="sun-web-app.context-root"/>
</condition>
<condition property="deploy.context.root.argument" value="&amp;contextroot=${sun-web-app.context-root}" else="/${ant.project.name}">
<isset property="sun-web-app.context-root"/>
</condition>
</target>
<target name="-parse-glassfish-web" depends="-init-cl-deployment-env" if="glassfish.web.present">
<tempfile prefix="gfv3" property="temp.gf.web" destdir="${java.io.tmpdir}"/>
<copy file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" tofile="${temp.gf.web}"/>
<!-- The doctype triggers resolution which can fail -->
<replace file="${temp.gf.web}">
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken>
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue>
</replace>
<replace file="${temp.gf.web}">
<replacetoken><![CDATA[<glassfish-web-app]]></replacetoken>
<replacevalue><![CDATA[--> <glassfish-web-app]]></replacevalue>
</replace>
<xmlproperty file="${temp.gf.web}" validate="false">
</xmlproperty>
<delete file="${temp.gf.web}"/>
<condition property="deploy.ant.client.url" value="${gfv3.url}${glassfish-web-app.context-root}" else="${gfv3.url}/${ant.project.name}">
<isset property="glassfish-web-app.context-root"/>
</condition>
<condition property="deploy.context.root.argument" value="&amp;contextroot=${glassfish-web-app.context-root}" else="/${ant.project.name}">
<isset property="glassfish-web-app.context-root"/>
</condition>
</target>
<target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present">
<property name="deploy.context.root.argument" value=""/>
</target>
<target name="-add-resources" depends="-init-cl-deployment-env" if="has.setup">
<tempfile prefix="gfv3" property="gfv3.resources.dir" destdir="${java.io.tmpdir}"/>
<mkdir dir="${gfv3.resources.dir}"/>
<mkdir dir="${gfv3.resources.dir}/META-INF"/>
<copy todir="${gfv3.resources.dir}/META-INF">
<fileset dir="${deploy.ant.resource.dir}"/>
</copy>
<jar destfile="${deploy.ant.archive}" update="true">
<fileset dir="${gfv3.resources.dir}"/>
</jar>
<delete dir="${gfv3.resources.dir}"/>
</target>
<target name="-deploy-ant" depends="-parse-glassfish-web, -parse-sun-web, -no-parse-sun-web,-add-resources" if="deploy.ant.enabled">
<antcall target="-deploy-without-pw"/>
<antcall target="-deploy-with-pw"/>
</target>
<target name="-deploy-without-pw" unless="gfv3.password">
<echo message="Deploying ${deploy.ant.archive}"/>
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/>
<get src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&amp;force=true&amp;name=${ant.project.name}"
dest="${gfv3.results.file}"/>
<delete file="${gfv3.results.file}"/>
</target>
<target name="-deploy-with-pw" if="gfv3.password">
<echo message="Deploying ${deploy.ant.archive}"/>
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/>
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&amp;force=true&amp;name=${ant.project.name}"
dest="${gfv3.results.file}"/>
<delete file="${gfv3.results.file}"/>
</target>
<target name="-undeploy-ant" depends="-init-cl-deployment-env" if="deploy.ant.enabled">
<antcall target="-undeploy-without-pw"/>
<antcall target="-undeploy-with-pw"/>
</target>
<target name="-undeploy-without-pw" unless="gfv3.password">
<echo message="Undeploying ${deploy.ant.archive}"/>
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<get src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}"
dest="${gfv3.results.file}"/>
<delete file="${gfv3.results.file}"/>
</target>
<target name="-undeploy-with-pw" if="gfv3.password">
<echo message="Undeploying ${deploy.ant.archive}"/>
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}"
dest="${gfv3.results.file}"/>
<delete file="${gfv3.results.file}"/>
</target>
</project>

1228
Inventario-ejb/nbproject/build-impl.xml

File diff suppressed because it is too large

8
Inventario-ejb/nbproject/genfiles.properties

@ -0,0 +1,8 @@
build.xml.data.CRC32=8d59014f
build.xml.script.CRC32=d98c699b
build.xml.stylesheet.CRC32=a737d6c5@1.75
# 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=8d59014f
nbproject/build-impl.xml.script.CRC32=e8535368
nbproject/build-impl.xml.stylesheet.CRC32=62693482@1.75

76
Inventario-ejb/nbproject/project.properties

@ -0,0 +1,76 @@
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=true
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
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form,**/.nbattrs
build.dir=build
build.ear.classes.dir=${build.dir}/classes
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
debug.classpath=${javac.classpath}:${build.classes.dir}
debug.test.classpath=\
${run.test.classpath}
dist.dir=dist
dist.ear.jar=${dist.dir}/${jar.name}
dist.jar=${dist.dir}/${jar.name}
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=\
${libs.javaee-endorsed-api-7.0.classpath}
excludes=
includes=**
j2ee.compile.on.save=true
j2ee.deploy.on.save=true
j2ee.platform=1.7
j2ee.platform.classpath=
j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar
j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar
j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar
j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar
j2ee.platform.wsit.classpath=
j2ee.server.type=gfv4ee7
jar.compress=false
jar.name=Inventario-ejb.jar
jars.in.ejbjar=false
javac.classpath=
javac.debug=true
javac.deprecation=false
javac.processorpath=\
${javac.classpath}:\
${libs.EclipseLink-GlassFish-v3.classpath}
javac.source=1.7
javac.target=1.7
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}
javac.test.processorpath=${javac.test.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.preview=true
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
meta.inf=${source.root}/conf
meta.inf.excludes=sun-cmp-mappings.xml
platform.active=JDK_1.8
resource.dir=setup
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
# Space-separated list of JVM arguments used when running a class with a main method or a unit test
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value):
runmain.jvmargs=
source.encoding=UTF-8
source.root=src
src.dir=${source.root}/java
test.src.dir=test

17
Inventario-ejb/nbproject/project.xml

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.j2ee.ejbjarproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2ee-ejbjarproject/3">
<name>Inventario-ejb</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<explicit-platform explicit-source-supported="true"/>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
</configuration>
</project>

1
Inventario-ejb/src/conf/MANIFEST.MF

@ -0,0 +1 @@
Manifest-Version: 1.0

14
Inventario-ejb/src/conf/META-INF/glassfish-resources.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="mysql_bdtenis_rootPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
<property name="serverName" value="localhost"/>
<property name="databaseName" value="bdtenis"/>
<property name="User" value="root"/>
<property name="Password" value="root"/>
<property name="URL" value="jdbc:mysql://localhost/bdtenis"/>
<property name="driverClass" value="org.gjt.mm.mysql.Driver"/>
</jdbc-connection-pool>
<jdbc-resource enabled="true" jndi-name="java:module/jdbc/inventarioNuevo" object-type="user" pool-name="mysql_bdtenis_rootPool"/>
<jdbc-resource enabled="true" jndi-name="java:module/jdbc/Inventario" object-type="user" pool-name="mysql_bdtenis_rootPool"/>
</resources>

8
Inventario-ejb/src/conf/persistence.xml

@ -0,0 +1,8 @@
<?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="Inventario-ejbPU" transaction-type="JTA">
<jta-data-source>jdbc/Inventario_New</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties/>
</persistence-unit>
</persistence>

115
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/CategoriaBL.java

@ -0,0 +1,115 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/StatelessEjbClass.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Stateless;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Categoria;
import mx.edu.tsj.chapala.sistemas.inventario.modelo.dao.CategoriaDAO;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
/**
*
* @author gael4
*/
@Stateless
public class CategoriaBL implements CategoriaBLLocal {
@Override
public Mensaje agregar(Categoria categoria) {
System.out.println("Llegaste al metodo de agregar");
CategoriaDAO categoriaDAO = new CategoriaDAO();
Categoria existeCategoria = categoriaDAO.buscarPorId(categoria);
//TODO: Agregar la logica
//Este es un mensaje para probar el commit
//TODO: agregar la logica
//Test de validaciones
if(categoria.getCategoria().isEmpty()){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if(categoria.getCategoria().length()>=45){
return Mensaje.DATOS_INCORRECTOS;
}
if (existeCategoria != null) {
return Mensaje.ELEMENTO_DUPLICADO;
}else{
categoriaDAO.agregar(categoria);
return Mensaje.SIN_ERROR;
}
}
// Add business logic below. (Right-click in editor and choose
// "Insert Code > Add Business Method")
@Override
public Mensaje buscarId(Categoria categoria) {
CategoriaDAO categoriaDAO = new CategoriaDAO();
Categoria existeLibro = categoriaDAO.buscarPorId(categoria);
if (existeLibro == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
categoriaDAO.buscarPorId(categoria);
return Mensaje.SIN_ERROR;
}
}
@Override
public Categoria buscarIdLi(Categoria categoria) {
CategoriaDAO a = new CategoriaDAO();
return a.buscarPorId(categoria);
}
@Override
public Mensaje eliminarCategoria(Categoria categoria) {
CategoriaDAO a = new CategoriaDAO();
Categoria existe = a.buscarPorId(categoria);
if(existe==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
else{
a.eliminar(categoria);
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje editarCategoria(Categoria categoria) {
System.out.println("Llegaste al metodo de editar");
CategoriaDAO categoriaDao = new CategoriaDAO();
Categoria existeCategoria = categoriaDao.buscarPorId(categoria);
//Test de validaciones
if(categoria.getCategoria().isEmpty()){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if(categoria.getCategoria().length()>=45){
return Mensaje.DATOS_INCORRECTOS;
}
if(categoria.getId()==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
else{
categoriaDao.editar(categoria);
return Mensaje.SIN_ERROR;
}
}
public List<Categoria> buscarTodos() {
CategoriaDAO categoriaDAO = new CategoriaDAO();
return categoriaDAO.buscarTodos();
}
}

32
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/CategoriaBLLocal.java

@ -0,0 +1,32 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/SessionLocal.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Local;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Categoria;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
/**
*
* @author gael4
*/
@Local
public interface CategoriaBLLocal {
Mensaje agregar(Categoria categoria);
Mensaje buscarId(Categoria categoria);
Mensaje eliminarCategoria(Categoria categoria);
Mensaje editarCategoria(Categoria categoria);
Categoria buscarIdLi (Categoria categoria);
List<Categoria> buscarTodos();
}

171
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/ColorBL.java

@ -0,0 +1,171 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/StatelessEjbClass.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Stateless;
import mx.edu.tsj.chapala.sistemas.inventario.modelo.dao.ColorDAO;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Color;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
/**
*
* @author Ivan Alejandro PC
*/
@Stateless
public class ColorBL implements ColorBLLocal {
@Override
public Mensaje agregar(Color color) {
System.out.println("Llegaste al metodo de agregar!!");
ColorDAO rolDAO = new ColorDAO();
if(color== null){
return Mensaje.CAMPOS_INCOMPLETOS;
}
Color existeRol = rolDAO.buscarPorId(color);
//TO DO: agregar la logica
//Test de validaciones
if(color.getColor().isEmpty()){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if(color.getColor().length()>=45 ){
return Mensaje.DATOS_INCORRECTOS;
}
if (existeRol != null) {
return Mensaje.ELEMENTO_DUPLICADO;
}else{
rolDAO.agregar(color);
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje buscarId(Color color) {
ColorDAO rolDAO = new ColorDAO();
Color existeRol = rolDAO.buscarPorId(color);
if(color== null){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if (existeRol == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
rolDAO.buscarPorId(color);
return Mensaje.SIN_ERROR;
}
}
@Override
public Color buscarIdLi(Color color) {
ColorDAO a = new ColorDAO();
//Aqui le movi
return a.buscarPorId(color);
}
/*@Override
public Autor eliminar(Autor autor) {
AutorDAO a = new AutorDAO();
a.eliminar(autor);
return autor;
}*/
@Override
public Mensaje eliminar(Color color) {
ColorDAO a = new ColorDAO();
Color existe = a.buscarPorId(color);
if(existe==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else if(color==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
a.eliminar(color);
return Mensaje.SIN_ERROR;
}
}
@Override
public List<Color> buscarTodos() {
ColorDAO rolDAO = new ColorDAO();
return rolDAO.buscarTodos();
}
@Override
public Mensaje buscarColor(Color color) {
ColorDAO rolDAO = new ColorDAO();
Color rE = rolDAO.buscarPorColorName(color);
if (rE == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
} else {
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje editar(Color color) {
System.out.println("Llegaste al metodo de editar");
ColorDAO a = new ColorDAO();
//Rol existeRol = a.buscarPorId(rol);
if(color== null){
return Mensaje.CAMPOS_INCOMPLETOS;
}
//Test de validaciones
if(color.getColor().isEmpty()){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if(color.getColor().length()>=45){
return Mensaje.DATOS_INCORRECTOS;
}
if(color.getId()==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
a.editar(color);
return Mensaje.SIN_ERROR;
}
//autorDao.editar(autor);
}
}

37
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/ColorBLLocal.java

@ -0,0 +1,37 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/SessionLocal.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Local;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Color;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
/**
*
* @author Ivan Alejandro PC
*/
@Local
public interface ColorBLLocal {
Mensaje agregar(Color color);
Mensaje buscarColor(Color color);
Mensaje buscarId(Color color);
Color buscarIdLi(Color color);
Mensaje eliminar(Color color);
Mensaje editar(Color color);
public List<Color> buscarTodos();
}

101
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/GeneroBL.java

@ -0,0 +1,101 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/StatelessEjbClass.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Stateless;
import mx.edu.tsj.chapala.sistemas.inventario.modelo.dao.GeneroDAO;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Genero;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
@Stateless
public class GeneroBL implements GeneroBLLocal {
public Mensaje agregar(Genero genero) {
System.out.println("Llegaste al metodo de agregar");
GeneroDAO generoDAO = new GeneroDAO();
Genero existeGenero = generoDAO.buscarPorId(genero);
if(genero.getGenero().isEmpty()){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if(genero.getGenero().length()>=45){
return Mensaje.DATOS_INCORRECTOS;
}
if (existeGenero != null) {
return Mensaje.ELEMENTO_DUPLICADO;
}else{
generoDAO.agregar(genero);
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje buscarId(Genero genero) {
GeneroDAO generoDAO = new GeneroDAO();
Genero existeGenero = generoDAO.buscarPorId(genero);
if (existeGenero == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
generoDAO.buscarPorId(genero);
return Mensaje.SIN_ERROR;
}
}
@Override
public Genero buscarIdLi(Genero genero) {
GeneroDAO a = new GeneroDAO();
return a.buscarPorId(genero);
}
@Override
public Mensaje eliminarGenero(Genero genero) {
GeneroDAO a = new GeneroDAO();
Genero existe = a.buscarPorId(genero);
if(existe==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
else{
a.eliminar(genero);
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje editarGenero(Genero genero) {
System.out.println("Llegaste al metodo de editar");
GeneroDAO proveedorDAO = new GeneroDAO();
Genero existeproveedor = proveedorDAO.buscarPorId(genero);
//Test de validaciones
if(genero.getGenero().isEmpty()){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if(genero.getGenero().length()>=45){
return Mensaje.DATOS_INCORRECTOS;
}
if(genero.getId()==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
else{
proveedorDAO.editar(genero);
return Mensaje.SIN_ERROR;
}
}
public List<Genero> buscarTodos() {
GeneroDAO generoDAO = new GeneroDAO();
return generoDAO.buscarTodos();
}
}

27
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/GeneroBLLocal.java

@ -0,0 +1,27 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/SessionLocal.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Local;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Genero;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
@Local
public interface GeneroBLLocal {
Mensaje agregar(Genero genero);
Mensaje buscarId(Genero genero);
Genero buscarIdLi(Genero genero);
Mensaje eliminarGenero(Genero genero);
Mensaje editarGenero(Genero genero);
List<Genero> buscarTodos();
}

117
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/MarcaBL.java

@ -0,0 +1,117 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/StatelessEjbClass.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Stateless;
import mx.edu.tsj.chapala.sistemas.inventario.modelo.dao.MarcaDAO;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Categoria;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Marca;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
/**
*
* @author gael4
*/
@Stateless
public class MarcaBL implements MarcaBLLocal {
@Override
public Mensaje agregar(Marca marca) {
System.out.println("Llegaste al metodo de agregar");
MarcaDAO marcaDAO = new MarcaDAO();
Marca existeMarca = marcaDAO.buscarPorId(marca);
//TODO: Agregar la logica
//Este es un mensaje para probar el commit
//TODO: agregar la logica
//Test de validaciones
if(marca.getMarca().isEmpty()){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if(marca.getMarca().length()>=45){
return Mensaje.DATOS_INCORRECTOS;
}
if (existeMarca != null) {
return Mensaje.ELEMENTO_DUPLICADO;
}else{
marcaDAO.agregar(marca);
return Mensaje.SIN_ERROR;
}
}
// Add business logic below. (Right-click in editor and choose
// "Insert Code > Add Business Method")
@Override
public Mensaje buscarId(Marca marca) {
MarcaDAO marcaDAO = new MarcaDAO();
Marca existeMarca = marcaDAO.buscarPorId(marca);
if (existeMarca == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
marcaDAO.buscarPorId(marca);
return Mensaje.SIN_ERROR;
}
}
@Override
public Marca buscarIdLi(Marca marca) {
MarcaDAO a = new MarcaDAO();
return a.buscarPorId(marca);
}
@Override
public Mensaje eliminarMarca(Marca marca) {
MarcaDAO a = new MarcaDAO();
Marca existe = a.buscarPorId(marca);
if(existe==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
else{
a.eliminar(marca);
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje editarMarca(Marca marca) {
System.out.println("Llegaste al metodo de editar");
MarcaDAO marcaDao = new MarcaDAO();
Marca existeMarca = marcaDao.buscarPorId(marca);
//Test de validaciones
if(marca.getMarca().isEmpty()){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if(marca.getMarca().length()>=45){
return Mensaje.DATOS_INCORRECTOS;
}
if(marca.getId()==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
else{
marcaDao.editar(marca);
return Mensaje.SIN_ERROR;
}
}
public List<Marca> buscarTodos() {
MarcaDAO marcaDAO = new MarcaDAO();
return marcaDAO.buscarTodos();
}
}

30
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/MarcaBLLocal.java

@ -0,0 +1,30 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/SessionLocal.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Local;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Marca;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
/**
*
* @author gael4
*/
@Local
public interface MarcaBLLocal {
Mensaje agregar(Marca marca);
Mensaje buscarId(Marca marca);
Mensaje eliminarMarca(Marca marca);
Mensaje editarMarca(Marca marca);
Marca buscarIdLi (Marca marca);
List<Marca> buscarTodos();
}

236
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/ProductosBL.java

@ -0,0 +1,236 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/StatelessEjbClass.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Stateless;
import mx.edu.tsj.chapala.sistemas.inventario.modelo.dao.ProductosDAO;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Productos;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
/**
*
* @author Ivan Alejandro PC
*/
@Stateless
public class ProductosBL implements ProductosBLLocal {
@Override
public Mensaje agregar(Productos productos) {
System.out.println("Llegaste al metodo de agregar!!");
ProductosDAO productosDAO = new ProductosDAO();
short status = 1;
productos.setStatus(status);
if (productos == null) {
return Mensaje.CAMPOS_INCOMPLETOS;
}
Productos existeProductos = productosDAO.buscarPorId(productos);
//TO DO: agregar la logica
//Test de validaciones
if (productos.getNombre().isEmpty() || productos.getDescripcion().isEmpty() || productos.getPrecio().isEmpty()
|| productos.getMaterial().isEmpty()
|| productos.getExistencia()== 0 || productos.getExistencia() < 0 || productos.getColorid()== null || productos.getProveedoresid() == null
|| productos.getUbicacionid()== null || productos.getTallaid()== null
|| productos.getMarcaid()== null || productos.getCategoriaid()== null
|| productos.getGeneroid()== null || productos.getStatus() == 0 ) {
return Mensaje.CAMPOS_INCOMPLETOS;
}
if (productos.getNombre().length() >= 45 || productos.getDescripcion().length() >= 100 || productos.getPrecio().length() >= 45
|| productos.getMaterial().length() >= 45 || productos.getExistencia() == 0 || productos.getExistencia() == -1 ) {
return Mensaje.DATOS_INCORRECTOS;
}
if(productos.getColorid() == null || productos.getProveedoresid()==null ||productos.getUbicacionid()==null || productos.getTallaid()==null
|| productos.getMarcaid()==null || productos.getCategoriaid()==null || productos.getGeneroid()==null){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if (existeProductos != null) {
return Mensaje.ELEMENTO_DUPLICADO;
} else {
productosDAO.agregar(productos);
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje buscarId(Productos productos) {
try{
ProductosDAO productosDAO = new ProductosDAO();
Productos existe = productosDAO.buscarPorId(productos);
if(existe.getStatus() == 0){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
if (productos == null) {
return Mensaje.CAMPOS_INCOMPLETOS;
}
if (existe == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
} else {
productosDAO.buscarPorId(productos);
return Mensaje.SIN_ERROR;
}
}
} catch (NullPointerException e) {
// Maneja la excepción o notifica el error
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
}
@Override
public Mensaje buscarNombre(Productos productos) {
try{
ProductosDAO productosDAO = new ProductosDAO();
Productos existe = productosDAO.buscarPorNombre(productos);
if(existe.getStatus()==0){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
if (existe== null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
} else {
return Mensaje.SIN_ERROR;
}
}
} catch (NullPointerException e) {
// Maneja la excepción o notifica el error
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
}
@Override
public Mensaje buscarExistencia(Productos productos) {
ProductosDAO productosDAO = new ProductosDAO();
Productos existe = productosDAO.buscarPorExistencia(productos);
if(existe.getStatus()==0){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
if (existe== null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
} else {
return Mensaje.SIN_ERROR;
}
}
}
@Override
public List<Productos> buscarStatus(short status) {
ProductosDAO productosDAO = new ProductosDAO();
return productosDAO.buscarStatus(status);
}
@Override
public Productos buscarIdLi(Productos productos) {
ProductosDAO a = new ProductosDAO();
//Aqui le movi
return a.buscarPorId(productos);
}
@Override
public Mensaje activarProductos(Productos productos) {
ProductosDAO a = new ProductosDAO();
Productos existe = a.buscarPorId(productos);
if(existe==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
else{
a.activar(productos);
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje desactivarProductos(Productos productos) {
try{
ProductosDAO a = new ProductosDAO();
Productos existe = a.buscarPorId(productos);
if(existe==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
else{
a.eliminar(productos);
return Mensaje.SIN_ERROR;
}
} catch (NullPointerException e) {
// Maneja la excepción o notifica el error
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
}
@Override
public Mensaje editar(Productos productos) {
try{
System.out.println("Llegaste al metodo de editar");
ProductosDAO a = new ProductosDAO();
if(productos.getStatus()==1){
if (productos == null) {
return Mensaje.CAMPOS_INCOMPLETOS;
}
Productos existeProductos = a.buscarPorId(productos);
//TO DO: agregar la logica
//Test de validaciones
if (productos.getNombre().isEmpty() || productos.getDescripcion().isEmpty() || productos.getPrecio().isEmpty()
|| productos.getMaterial().isEmpty()
|| productos.getExistencia()== 0 || productos.getExistencia() < 0 || productos.getColorid()==null || productos.getProveedoresid() == null
|| productos.getUbicacionid()== null || productos.getTallaid()== null
|| productos.getMarcaid()== null || productos.getCategoriaid()== null
|| productos.getGeneroid()== null || productos.getStatus() == 0) {
return Mensaje.CAMPOS_INCOMPLETOS;
}
if (productos.getNombre().length() >= 45 || productos.getDescripcion().length() >= 100 || productos.getPrecio().length() >= 45
|| productos.getMaterial().length() >= 45 || productos.getExistencia() == 0 || productos.getExistencia() == -1 ) {
return Mensaje.DATOS_INCORRECTOS;
}
if(productos.getColorid()==null || productos.getProveedoresid()==null ||productos.getUbicacionid()==null || productos.getTallaid()==null
|| productos.getMarcaid()==null || productos.getCategoriaid()==null || productos.getGeneroid()==null){
return Mensaje.CAMPOS_INCOMPLETOS;
}
/*if (existeProductos != null) {
return Mensaje.ELEMENTO_DUPLICADO;
}*/ else {
a.editar(productos);
return Mensaje.SIN_ERROR;
}
}else{
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
} catch (NullPointerException e) {
// Maneja la excepción o notifica el error
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
}
}

45
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/ProductosBLLocal.java

@ -0,0 +1,45 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/SessionLocal.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Local;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Productos;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
/**
*
* @author Ivan Alejandro PC
*/
@Local
public interface ProductosBLLocal {
Mensaje agregar(Productos productos);
Mensaje buscarId(Productos productos);
Productos buscarIdLi(Productos productos);
Mensaje buscarNombre(Productos productos);
Mensaje buscarExistencia(Productos productos);
//Mensaje buscarStatus(Usuarios usuarios);
Mensaje editar(Productos productos);
public List<Productos> buscarStatus(short status);
Mensaje activarProductos(Productos productos);
Mensaje desactivarProductos(Productos productos);
//
}

132
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/ProveedoresBL.java

@ -0,0 +1,132 @@
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Stateless;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Proveedores;
import mx.edu.tsj.chapala.sistemas.inventario.modelo.dao.ProveedoresDAO;
//import mx.edu.tsj.chapala.sistemas.inventario.modelo.Proveedores;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
@Stateless
public class ProveedoresBL implements ProveedoresBLLocal {
// Add business logic below. (Right-click in editor and choose
// "Insert Code > Add Business Method")
@Override
public Mensaje agregar(Proveedores proveedor) {
System.out.println("Llegaste al metodo de agregar");
ProveedoresDAO ProveedorDAO = new ProveedoresDAO();
Proveedores existeProveedor = ProveedorDAO.buscarPorId(proveedor);
if(proveedor.getNombre().isEmpty() || proveedor.getCorreo().isEmpty()|| proveedor.getDireccion().isEmpty()
|| proveedor.getPais().isEmpty() || proveedor.getEstado().isEmpty()|| proveedor.getCiudad().isEmpty() || proveedor.getTelefono().isEmpty()){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if(proveedor.getNombre().length()>=255 || proveedor.getCorreo().length()>=70 || proveedor.getDireccion().length()>=100
|| proveedor.getPais().length()>=40 || proveedor.getCiudad().length()>=45 ||proveedor.getEstado().length()>=45 || proveedor.getTelefono().length()>=20){
return Mensaje.DATOS_INCORRECTOS;
}
if (existeProveedor != null) {
return Mensaje.ELEMENTO_DUPLICADO;
}else{
ProveedorDAO.agregar(proveedor);
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje buscarId(Proveedores proveedor) {
ProveedoresDAO ProveedorDAO = new ProveedoresDAO();
Proveedores existeProovedor = ProveedorDAO.buscarPorId(proveedor);
if (existeProovedor == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
ProveedorDAO.buscarPorId(proveedor);
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje buscarNombre(Proveedores proveedor) {
ProveedoresDAO proveedorDAO = new ProveedoresDAO();
Proveedores existeProveedor = proveedorDAO.buscarPorNombre(proveedor);
if (existeProveedor == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
proveedorDAO.buscarPorNombre(proveedor);
return Mensaje.SIN_ERROR;
}
}
@Override
public Proveedores buscarIdLi(Proveedores proveedor) {
ProveedoresDAO a = new ProveedoresDAO();
return a.buscarPorId(proveedor);
}
@Override
public Mensaje eliminarProveedor(Proveedores proveedores) {
ProveedoresDAO a = new ProveedoresDAO();
Proveedores existe = a.buscarPorId(proveedores);
if(existe==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
else{
a.eliminar(proveedores);
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje activarProveedor(Proveedores proveedores) {
ProveedoresDAO a = new ProveedoresDAO();
Proveedores existe = a.buscarPorId(proveedores);
if(existe==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
else{
a.activar(proveedores);
return Mensaje.SIN_ERROR;
}
}
//
@Override
public Mensaje editarProveedor(Proveedores proveedor) {
System.out.println("Llegaste al metodo de editar");
ProveedoresDAO proveedorDAO = new ProveedoresDAO();
Proveedores existeproveedor = proveedorDAO.buscarPorId(proveedor);
//Test de validaciones
if(proveedor.getNombre().isEmpty() || proveedor.getCorreo().isEmpty()|| proveedor.getDireccion().isEmpty()
|| proveedor.getCiudad().isEmpty() || proveedor.getTelefono().isEmpty()){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if(proveedor.getNombre().length()>=255 || proveedor.getCorreo().length()>=70 || proveedor.getDireccion().length()>=100
|| proveedor.getCiudad().length()>=45 || proveedor.getTelefono().length()>=20){
return Mensaje.DATOS_INCORRECTOS;
}
if(proveedor.getId()==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
else{
proveedorDAO.editar(proveedor);
return Mensaje.SIN_ERROR;
}
}
@Override
public List<Proveedores> buscarStatus(short status) {
ProveedoresDAO usuariosDAO = new ProveedoresDAO();
return usuariosDAO.buscarPorStatus(status);
}
}

33
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/ProveedoresBLLocal.java

@ -0,0 +1,33 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/SessionLocal.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Local;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Proveedores;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
/**
*
* @author omara
*/
@Local
public interface ProveedoresBLLocal {
Mensaje agregar(Proveedores proveedor);
Mensaje buscarId(Proveedores proveedor);
Mensaje buscarNombre(Proveedores proveedor);
Proveedores buscarIdLi(Proveedores proveedor);
Mensaje eliminarProveedor(Proveedores proveedores);
Mensaje editarProveedor(Proveedores proveedor);
Mensaje activarProveedor(Proveedores proveedores);
List<Proveedores> buscarStatus(short status);
}

171
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/RolBL.java

@ -0,0 +1,171 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/StatelessEjbClass.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Stateless;
import mx.edu.tsj.chapala.sistemas.inventario.modelo.dao.RolDAO;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Rol;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
/**
*
* @author Ivan Alejandro PC
*/
@Stateless
public class RolBL implements RolBLLocal {
@Override
public Mensaje agregar(Rol rol) {
System.out.println("Llegaste al metodo de agregar!!");
RolDAO rolDAO = new RolDAO();
if(rol== null){
return Mensaje.CAMPOS_INCOMPLETOS;
}
Rol existeRol = rolDAO.buscarPorId(rol);
//TO DO: agregar la logica
//Test de validaciones
if(rol.getRolUsuario().isEmpty()){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if(rol.getRolUsuario().length()>=45 ){
return Mensaje.DATOS_INCORRECTOS;
}
if (existeRol != null) {
return Mensaje.ELEMENTO_DUPLICADO;
}else{
rolDAO.agregar(rol);
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje buscarId(Rol rol) {
RolDAO rolDAO = new RolDAO();
Rol existeRol = rolDAO.buscarPorId(rol);
if(rol== null){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if (existeRol == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
rolDAO.buscarPorId(rol);
return Mensaje.SIN_ERROR;
}
}
@Override
public Rol buscarIdLi(Rol rol) {
RolDAO a = new RolDAO();
//Aqui le movi
return a.buscarPorId(rol);
}
/*@Override
public Autor eliminar(Autor autor) {
AutorDAO a = new AutorDAO();
a.eliminar(autor);
return autor;
}*/
@Override
public Mensaje eliminar(Rol rol) {
RolDAO a = new RolDAO();
Rol existe = a.buscarPorId(rol);
if(existe==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else if(rol==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
a.eliminar(rol);
return Mensaje.SIN_ERROR;
}
}
@Override
public List<Rol> buscarTodos() {
RolDAO rolDAO = new RolDAO();
return rolDAO.buscarTodos();
}
@Override
public Mensaje buscarRol(Rol rol) {
RolDAO rolDAO = new RolDAO();
Rol rE = rolDAO.buscarPorRolName(rol);
if (rE == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
} else {
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje editar(Rol rol) {
System.out.println("Llegaste al metodo de editar");
RolDAO a = new RolDAO();
//Rol existeRol = a.buscarPorId(rol);
if(rol== null){
return Mensaje.CAMPOS_INCOMPLETOS;
}
//Test de validaciones
if(rol.getRolUsuario().isEmpty()){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if(rol.getRolUsuario().length()>=45){
return Mensaje.DATOS_INCORRECTOS;
}
if(rol.getId()==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
a.editar(rol);
return Mensaje.SIN_ERROR;
}
//autorDao.editar(autor);
}
}

37
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/RolBLLocal.java

@ -0,0 +1,37 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/SessionLocal.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Local;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Rol;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
/**
*
* @author Ivan Alejandro PC
*/
@Local
public interface RolBLLocal {
Mensaje agregar(Rol rol);
Mensaje buscarRol(Rol rol);
Mensaje buscarId(Rol rol);
Rol buscarIdLi(Rol rol);
Mensaje eliminar(Rol rol);
Mensaje editar(Rol rol);
public List<Rol> buscarTodos();
}

111
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/TallaBL.java

@ -0,0 +1,111 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/StatelessEjbClass.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Stateless;
import mx.edu.tsj.chapala.sistemas.inventario.modelo.dao.TallaDAO;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Talla;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
/**
*
* @author gael4
*/
@Stateless
public class TallaBL implements TallaBLLocal {
@Override
public Mensaje agregar(Talla talla) {
System.out.println("Llegaste al metodo de agregar");
TallaDAO tallaDAO = new TallaDAO();
Talla existeMarca = tallaDAO.buscarPorId(talla);
//TODO: Agregar la logica
//Este es un mensaje para probar el commit
//TODO: agregar la logica
//Test de validaciones
if(talla.getTalla().isEmpty()){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if(talla.getTalla().length()>=45){
return Mensaje.DATOS_INCORRECTOS;
}
if (existeMarca != null) {
return Mensaje.ELEMENTO_DUPLICADO;
}else{
tallaDAO.agregar(talla);
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje buscarId(Talla talla) {
TallaDAO tallaDAO = new TallaDAO();
Talla existeTalla = tallaDAO.buscarPorId(talla);
if (existeTalla == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
tallaDAO.buscarPorId(talla);
return Mensaje.SIN_ERROR;
}
}
@Override
public Talla buscarIdLi(Talla talla) {
TallaDAO a = new TallaDAO();
return a.buscarPorId(talla);
}
@Override
public Mensaje eliminarTalla(Talla talla) {
TallaDAO a = new TallaDAO();
Talla existe = a.buscarPorId(talla);
if(existe==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
else{
a.eliminar(talla);
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje editarTalla(Talla talla) {
System.out.println("Llegaste al metodo de editar");
TallaDAO tallaDao = new TallaDAO();
Talla existeTalla = tallaDao.buscarPorId(talla);
//Test de validaciones
if(talla.getTalla().isEmpty()){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if(talla.getTalla().length()>=45){
return Mensaje.DATOS_INCORRECTOS;
}
if(talla.getId()==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
else{
tallaDao.editar(talla);
return Mensaje.SIN_ERROR;
}
}
public List<Talla> buscarTodos() {
TallaDAO tallaDAO = new TallaDAO();
return tallaDAO.buscarTodos();
}
}

30
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/TallaBLLocal.java

@ -0,0 +1,30 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/SessionLocal.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Local;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Talla;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
/**
*
* @author gael4
*/
@Local
public interface TallaBLLocal {
Mensaje agregar(Talla talla);
Mensaje buscarId(Talla talla);
Mensaje eliminarTalla(Talla talla);
Mensaje editarTalla(Talla talla);
Talla buscarIdLi (Talla talla);
List<Talla> buscarTodos();
}

40
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/UbicacionBLLocal.java

@ -0,0 +1,40 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/SessionLocal.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Local;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Ubicacion;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
/**
*
* @author Ivan Alejandro PC
*/
@Local
public interface UbicacionBLLocal {
Mensaje agregar(Ubicacion ubicacion);
Mensaje buscarId(Ubicacion ubicacion);
Ubicacion buscarIdLi(Ubicacion ubicacion);
Mensaje buscarNombre(Ubicacion ubicacion);
Mensaje buscarEstante(Ubicacion ubicacion);
Mensaje buscarFila(Ubicacion ubicacion);
Mensaje eliminar(Ubicacion ubicacion);
Mensaje editar(Ubicacion ubicacion);
public List<Ubicacion> buscarTodos();
}

189
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/UbucacionBL.java

@ -0,0 +1,189 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/StatelessEjbClass.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Stateless;
import mx.edu.tsj.chapala.sistemas.inventario.modelo.dao.UbicacionDAO;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Ubicacion;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
/**
*
* @author Ivan Alejandro PC
*/
@Stateless
public class UbucacionBL implements UbicacionBLLocal {
@Override
public Mensaje agregar(Ubicacion ubicacion) {
System.out.println("Llegaste al metodo de agregar!!");
UbicacionDAO ubicacionDAO = new UbicacionDAO();
if(ubicacion.getNombreAlmacen().isEmpty() || ubicacion.getEstante().isEmpty() || ubicacion.getFila() == 0 ||
ubicacion.getFila()<= 0){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if(ubicacion== null){
return Mensaje.CAMPOS_INCOMPLETOS;
}
Ubicacion existeUbicacion = ubicacionDAO.buscarPorId(ubicacion);
if(ubicacion.getNombreAlmacen().length()>=255 | ubicacion.getEstante().length()>=100 ){
return Mensaje.DATOS_INCORRECTOS;
}
if (existeUbicacion != null) {
return Mensaje.ELEMENTO_DUPLICADO;
}else{
ubicacionDAO.agregar(ubicacion);
return Mensaje.SIN_ERROR;
}
}
@Override
public List<Ubicacion> buscarTodos() {
UbicacionDAO u = new UbicacionDAO();
return u.buscarTodos();
}
@Override
public Mensaje buscarId(Ubicacion ubicacion) {
UbicacionDAO ubicacionDAO = new UbicacionDAO();
Ubicacion existeUbicacion = ubicacionDAO.buscarPorId(ubicacion);
if(ubicacion== null ){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if (existeUbicacion == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
ubicacionDAO.buscarPorId(ubicacion);
return Mensaje.SIN_ERROR;
}
}
@Override
public Ubicacion buscarIdLi(Ubicacion ubicacion) {
UbicacionDAO ubicacionDAO = new UbicacionDAO();
//Aqui le movi
return ubicacionDAO.buscarPorId(ubicacion);
}
@Override
public Mensaje buscarNombre(Ubicacion ubicacion) {
UbicacionDAO ubicacionDAO = new UbicacionDAO();
Ubicacion existeUbicacion = ubicacionDAO.buscarPorNombre(ubicacion);
if (existeUbicacion == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
} else {
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje buscarEstante(Ubicacion ubicacion) {
UbicacionDAO ubicacionDAO = new UbicacionDAO();
Ubicacion existeUbicacion = ubicacionDAO.buscarPorEstante(ubicacion);
if (existeUbicacion == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
} else {
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje buscarFila(Ubicacion ubicacion) {
UbicacionDAO ubicacionDAO = new UbicacionDAO();
Ubicacion existeUbicacion = ubicacionDAO.buscarPorFila(ubicacion);
if (existeUbicacion == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
} else {
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje eliminar(Ubicacion ubicacion) {
UbicacionDAO ubicacionDAO = new UbicacionDAO();
Ubicacion existe = ubicacionDAO.buscarPorId(ubicacion);
if(existe==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else if(ubicacion==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
ubicacionDAO.eliminar(ubicacion);
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje editar(Ubicacion ubicacion) {
System.out.println("Llegaste al metodo de editar");
UbicacionDAO ubicacionDAO = new UbicacionDAO();
//Rol existeRol = a.buscarPorId(rol);
if(ubicacion== null){
return Mensaje.CAMPOS_INCOMPLETOS;
}
//Test de validaciones
if(ubicacion.getNombreAlmacen().isEmpty() | ubicacion.getEstante().isEmpty() | ubicacion.getFila() == 0
||ubicacion.getFila()<= 0){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if(ubicacion.getNombreAlmacen().length()>=255 | ubicacion.getEstante().length()>=100 ){
return Mensaje.DATOS_INCORRECTOS;
}
if(ubicacion.getId()==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
ubicacionDAO.editar(ubicacion);
return Mensaje.SIN_ERROR;
}
//autorDao.editar(autor);
}
}

271
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/UsuariosBL.java

@ -0,0 +1,271 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/StatelessEjbClass.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Stateless;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import mx.edu.tsj.chapala.sistemas.inventario.modelo.dao.RolDAO;
import mx.edu.tsj.chapala.sistemas.inventario.modelo.dao.UsuariosDAO;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Rol;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Usuarios;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
/**
*
* @author Ivan Alejandro PC
*/
@Stateless
public class UsuariosBL implements UsuariosBLLocal {
@Override
public Mensaje agregar(Usuarios usuarios) {
System.out.println("Llegaste al metodo de agregar!!");
UsuariosDAO usuariosDAO = new UsuariosDAO();
RolDAO rolDAO = new RolDAO();
short status = 1;
usuarios.setStatus(status);
if (usuarios == null) {
return Mensaje.CAMPOS_INCOMPLETOS;
}
Usuarios existeUsuarios = usuariosDAO.buscarPorId(usuarios);
//TO DO: agregar la logica
//Test de validaciones
if (usuarios.getUsuario().isEmpty() || usuarios.getPassword().isEmpty() || usuarios.getSexo().isEmpty()
|| usuarios.getStatus() == 0) {
return Mensaje.CAMPOS_INCOMPLETOS;
}
if (usuarios.getUsuario().length() >= 45 || usuarios.getPassword().length() >= 45 || usuarios.getSexo().length() >= 45) {
return Mensaje.DATOS_INCORRECTOS;
}
if(usuarios.getRolid()==null){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if (existeUsuarios != null) {
return Mensaje.ELEMENTO_DUPLICADO;
} else {
usuariosDAO.agregar(usuarios);
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje buscarId(Usuarios usuarios) {
try {
// Intenta acceder al objeto
UsuariosDAO usuariosDAO = new UsuariosDAO();
Usuarios existeUsuario = usuariosDAO.buscarPorId(usuarios);
if (usuarios.getId()!= null) {
// Acceder a propiedades o métodos del objeto
if(existeUsuario.getStatus() == 0 ){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
if (usuarios == null) {
return Mensaje.CAMPOS_INCOMPLETOS;
}
if (existeUsuario == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
} else {
usuariosDAO.buscarPorId(usuarios);
return Mensaje.SIN_ERROR;
}
}
}else{
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
} catch (NullPointerException e) {
// Maneja la excepción o notifica el error
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
}
@Override
public Mensaje buscarNombre(Usuarios usuarios) {
try{
UsuariosDAO usuariosDAO = new UsuariosDAO();
Usuarios existeUsuario = usuariosDAO.buscarPorNombre(usuarios);
if(existeUsuario.getStatus()==0){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}else{
if (existeUsuario == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
} else {
return Mensaje.SIN_ERROR;
}
}
} catch (NullPointerException e) {
// Maneja la excepción o notifica el error
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
}
@Override
public List<Usuarios> buscarStatus(short status) {
UsuariosDAO usuariosDAO = new UsuariosDAO();
return usuariosDAO.buscarStatus(status);
}
@Override
public Usuarios buscarIdLi(Usuarios usuarios) {
UsuariosDAO a = new UsuariosDAO();
//Aqui le movi
if (a.buscarPorId(usuarios) != null) {
return a.buscarPorId(usuarios);
// Realizar operaciones con el objeto
} else {
return null;
// Manejar el caso en que el objeto sea null
}
}
/*@Override
public Autor eliminar(Autor autor) {
AutorDAO a = new AutorDAO();
a.eliminar(autor);
return autor;
}*/
@Override
public Mensaje activarUsuarios(Usuarios usuarios) {
UsuariosDAO a = new UsuariosDAO();
Usuarios existe = a.buscarPorId(usuarios);
if(existe==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
else{
a.activar(usuarios);
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje desactivarUsuarios(Usuarios usuarios) {
UsuariosDAO a = new UsuariosDAO();
Usuarios existe = a.buscarPorId(usuarios);
if(existe==null){
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
else{
a.eliminar(usuarios);
return Mensaje.SIN_ERROR;
}
}
@Override
public Mensaje editar(Usuarios usuarios) {
System.out.println("Llegaste al metodo de editar");
UsuariosDAO a = new UsuariosDAO();
//Usuarios existeUsuario = a.buscarPorId(usuarios);
if(usuarios.getStatus()==1){
if (usuarios == null) {
return Mensaje.CAMPOS_INCOMPLETOS;
}
//Test de validaciones
if (usuarios.getUsuario().isEmpty() || usuarios.getPassword().isEmpty()) {
return Mensaje.CAMPOS_INCOMPLETOS;
}
if (usuarios.getUsuario().length() >= 45 || usuarios.getPassword().length() >= 45) {
return Mensaje.DATOS_INCORRECTOS;
}
if(usuarios.getRolid()==null){
return Mensaje.CAMPOS_INCOMPLETOS;
}
if (usuarios.getId() == null) {
return Mensaje.ELEMENTO_NO_ENCONTRADO;
} else {
a.editar(usuarios);
return Mensaje.SIN_ERROR;
}
}else{
return Mensaje.ELEMENTO_NO_ENCONTRADO;
}
//autorDao.editar(autor);
}
//Test e login
//Este si funciona pero solo valida usuario y password
public Usuarios buscarPorLoginBL(String username, String password) {
if (username == null || password == null) {
return null;
}
UsuariosDAO usuariosDAO = new UsuariosDAO(); // Instanciar tu clase DAO aquí, o inyectarla si estás usando CDI
return usuariosDAO.buscarPorLoginV2(username, password);
}
/*public Usuarios buscarPorLoginStatus(boolean status, Usuarios a) {
UsuariosDAO usuariosDAO = new UsuariosDAO();
return (Usuarios) usuariosDAO.buscarLogin(status, a.getUsuario(), a.getPassword());
}*/
public Usuarios buscarPorLoginStatus(boolean status, Usuarios a) {
if (a.getUsuario().isEmpty() || a.getPassword().isEmpty()) {
System.out.println("Por favor, ingrese usuario y contraseña.");
return null;
}
UsuariosDAO usuariosDAO = new UsuariosDAO();
//Usuarios usuario = (Usuarios) usuariosDAO.buscarLogin(status, a.getUsuario(), a.getPassword());
Usuarios usuario = usuariosDAO.buscarLogin(status, a.getUsuario(), a.getPassword());
if (usuario == null) {
System.out.println("Usuario o contraseña incorrectos.");
} else if (usuario.getStatus() == 0) {
System.out.println("El usuario no se ha registrado.");
}
return usuario;
}
//-----------------
}

43
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/UsuariosBLLocal.java

@ -0,0 +1,43 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/J2EE/EJB30/SessionLocal.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
import java.util.List;
import javax.ejb.Local;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Usuarios;
//import mx.edu.chapala.tsj.sistemas.modelo1.Autor;
//import mx.edu.chapala.tsj.sistemas.msg.Mensaje;
import mx.edu.tsj.chapala.sistemas.inventario.msg.Mensaje;
/**
*
* @author Ivan Alejandro PC
*/
@Local
public interface UsuariosBLLocal {
Mensaje agregar(Usuarios usuarios);
Mensaje buscarId(Usuarios usuarios);
Usuarios buscarIdLi(Usuarios usuarios);
Mensaje buscarNombre(Usuarios usuarios);
//Mensaje buscarStatus(Usuarios usuarios);
Mensaje editar(Usuarios usuarios);
public List<Usuarios> buscarStatus(short status);
Mensaje activarUsuarios(Usuarios usuarios);
Mensaje desactivarUsuarios(Usuarios usuarios);
public Usuarios buscarPorLoginBL(String username, String password);
public Usuarios buscarPorLoginStatus(boolean status, Usuarios a);
}

13
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/bl/bl.java

@ -0,0 +1,13 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.bl;
/**
*
* @author Ivan Alejandro PC
*/
public class bl {
}

102
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/CategoriaDAO.java

@ -0,0 +1,102 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.dao;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Categoria;
/**
*
* @author gael4 //hola
*/
public class CategoriaDAO {
private EntityManager em; //Manejadro de identidades
public CategoriaDAO() {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Inventario-ejbPU");
em = emf.createEntityManager();
}
/*
Este es un prueba de actualizar
*/
public void agregar(Categoria a){
em.getTransaction().begin();//Empezar
em.persist(a);//Almacenar en la BD
em.getTransaction().commit();// terminar
}
public void editar(Categoria a){
em.getTransaction().begin();//Empezar
em.merge(a);//Actualizar en la BD
em.getTransaction().commit();// terminar
}
public void eliminar(Categoria a){
em.getTransaction().begin();//Empezar
em.remove(em.merge(a));//Eliminar en la BD
em.getTransaction().commit();// terminar
}
public Categoria buscarPorId(Categoria a){
if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Categoria.findById");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Categoria) q.getResultList().get(0);
}
}
public Categoria buscarPorGenero(Categoria a){
if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Genero.findByGenero");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Categoria) q.getResultList().get(0);
}
}
public Categoria buscarTodos(Categoria a){
if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Genero.findAll");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Categoria) q.getResultList().get(0);
}
}
public List<Categoria> buscarTodos(){
Query q = em.createNamedQuery("Categoria.findAll");
return q.getResultList();
}
}

96
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/ColorDAO.java

@ -0,0 +1,96 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.dao;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Color;
/**
*
* @author Ivan Alejandro PC
*/
public class ColorDAO {
private EntityManager em; //Manejadro de identidades
public ColorDAO() {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Inventario-ejbPU");
em = emf.createEntityManager();
}
/*
Este es un prueba de actualizar
*/
public void agregar(Color a){
em.getTransaction().begin();//Empezar
em.persist(a);//Almacenar en la BD
em.getTransaction().commit();// terminar
}
public void editar(Color a){
em.getTransaction().begin();//Empezar
em.merge(a);//Actualizar en la BD
em.getTransaction().commit();// terminar
}
public void eliminar(Color a){
em.getTransaction().begin();//Empezar
em.remove(em.merge(a));//Eliminar en la BD
em.getTransaction().commit();// terminar
}
public Color buscarPorColorName(Color a){
/*if(a.getStatus()==0){
return null;
}*/
if (a.getColor()== null) {
return null;
}
Query q = em.createNamedQuery("Color.findByColor");
q.setParameter("rolUsuario", a.getColor());
List<Color> resultList = q.getResultList();
if(resultList.isEmpty()){
return null;
} else {
return resultList.get(0);
}
}
public Color buscarPorId(Color a){
if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Color.findById");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Color) q.getResultList().get(0);
}
}
public List<Color> buscarTodos(){
Query q = em.createNamedQuery("Color.findAll");
return q.getResultList();
}
}

99
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/GeneroDAO.java

@ -0,0 +1,99 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.dao;
import java.util.Collections;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Genero;
/**
*
* @author Ivan Alejandro PC
*/
public class GeneroDAO {
private EntityManager em; //Manejadro de identidades
public GeneroDAO() {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Inventario-ejbPU");
em = emf.createEntityManager();
}
/*
Este es un prueba de actualizar
*/
public void agregar(Genero a){
em.getTransaction().begin();//Empezar
em.persist(a);//Almacenar en la BD
em.getTransaction().commit();// terminar
}
public void editar(Genero a){
em.getTransaction().begin();//Empezar
em.merge(a);//Actualizar en la BD
em.getTransaction().commit();// terminar
}
public void eliminar(Genero a){
em.getTransaction().begin();//Empezar
em.remove(em.merge(a));//Eliminar en la BD
em.getTransaction().commit();// terminar
}
public Genero buscarPorId(Genero a){
if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Genero.findById");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Genero) q.getResultList().get(0);
}
}
public Genero buscarPorGenero(Genero a){
if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Genero.findByGenero");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Genero) q.getResultList().get(0);
}
}
public List<Genero> buscarTodos(){
/*if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Genero.findAll");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return q.getResultList();
}*/
Query q = em.createNamedQuery("Genero.findAll");
return q.getResultList();
}
}

100
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/MarcaDAO.java

@ -0,0 +1,100 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.dao;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Marca;
/**
*
* @author Ivan Alejandro PC
*/
public class MarcaDAO {
private EntityManager em; //Manejadro de identidades
public MarcaDAO() {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Inventario-ejbPU");
em = emf.createEntityManager();
}
/*
Este es un prueba de actualizar
*/
public void agregar(Marca a){
em.getTransaction().begin();//Empezar
em.persist(a);//Almacenar en la BD
em.getTransaction().commit();// terminar
}
public void editar(Marca a){
em.getTransaction().begin();//Empezar
em.merge(a);//Actualizar en la BD
em.getTransaction().commit();// terminar
}
public void eliminar(Marca a){
em.getTransaction().begin();//Empezar
em.remove(em.merge(a));//Eliminar en la BD
em.getTransaction().commit();// terminar
}
public Marca buscarPorId(Marca a){
if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Marca.findById");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Marca) q.getResultList().get(0);
}
}
public Marca buscarPorGenero(Marca a){
if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Marca.findByMarca");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Marca) q.getResultList().get(0);
}
}
public Marca buscarTodos(Marca a){
if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Marca.findAll");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Marca) q.getResultList().get(0);
}
}
public List<Marca> buscarTodos(){
Query q = em.createNamedQuery("Marca.findAll");
return q.getResultList();
}
}

134
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/ProductosDAO.java

@ -0,0 +1,134 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.dao;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Productos;
/**
*
* @author Ivan Alejandro PC
*/
public class ProductosDAO {
private EntityManager em; //Manejadro de identidades
public ProductosDAO() {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Inventario-ejbPU");
em = emf.createEntityManager();
}
/*
Este es un prueba de actualizar
*/
public void agregar(Productos a){
em.getTransaction().begin();//Empezar
em.persist(a);//Almacenar en la BD
em.getTransaction().commit();// terminar
}
public void editar(Productos a){
em.getTransaction().begin();//Empezar
em.merge(a);//Actualizar en la BD
em.getTransaction().commit();// terminar
}
public void activar(Productos a){
em.getTransaction().begin();//Empezar
//em.remove(em.merge(a));//Eliminar en la BD
a.setStatus((short)1);
em.merge(a);
em.getTransaction().commit();// terminar
}
public void eliminar(Productos a){
em.getTransaction().begin();//Empezar
//em.remove(em.merge(a));//Eliminar en la BD
a.setStatus((short)0);
em.merge(a);
em.getTransaction().commit();// terminar
}
public Productos buscarPorId(Productos a){
if (a != null) {
Query q = em.createNamedQuery("Productos.findById");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Productos) q.getResultList().get(0);
}
// Hacer algo con el objeto
} else {
return null;
// El objeto es null, manejar este caso
}
/* if (a == null || a.getId()== null | a.getId() == -1) {
return null;
}*/
}
public Productos buscarPorNombre(Productos a){
/*if(a.getStatus()==0){
return null;
}*/
if (a.getNombre()== null) {
return null;
}
Query q = em.createNamedQuery("Productos.findByNombre");
q.setParameter("nombre", a.getNombre());
List<Productos> resultList = q.getResultList();
if(resultList.isEmpty()){
return null;
} else {
return resultList.get(0);
}
}
public List<Productos> buscarStatus(short status) {
Query q = em.createNamedQuery("Productos.findByStatus");
q.setParameter("status", status);
return q.getResultList();
}
public List<Productos> buscarTodos(boolean status){
Query q = em.createNamedQuery("Productos.findAll");
int s = status?1:0;
q.setParameter("status", s);
return q.getResultList();
}
public Productos buscarPorExistencia(Productos a){
if (a == null || a.getId()== null || a.getExistencia()==0 || a.getExistencia()==-1) {
return null;
}
Query q = em.createNamedQuery("Productos.findByExistencia");
q.setParameter("existencia", a.getExistencia());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Productos) q.getResultList();
}
}
}

140
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/ProveedoresDAO.java

@ -0,0 +1,140 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.dao;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
//import mx.edu.tsj.chapala.sistemas.inventario.modelo.Proveedores;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Proveedores;
/**
*
* @author Ivan Alejandro PC
*/
public class ProveedoresDAO {
private EntityManager em; //Manejadro de identidades
public ProveedoresDAO() {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Inventario-ejbPU");
em = emf.createEntityManager();
}
/*
Este es un prueba de actualizar
*/
public void agregar(Proveedores a){
em.getTransaction().begin();//Empezar
em.persist(a);//Almacenar en la BD
em.getTransaction().commit();// terminar
}
public void editar(Proveedores a){
em.getTransaction().begin();//Empezar
em.merge(a);//Actualizar en la BD
em.getTransaction().commit();// terminar
}
public void eliminar(Proveedores a){
em.getTransaction().begin();//Empezar
//em.remove(em.merge(a));//Eliminar en la BD
a.setStatus((short)0);
em.merge(a);
em.getTransaction().commit();// terminar
}
public void activar(Proveedores a){
em.getTransaction().begin();//Empezar
//em.remove(em.merge(a));//Eliminar en la BD
a.setStatus((short)1);
em.merge(a);
em.getTransaction().commit();// terminar
}
public Proveedores buscarPorId(Proveedores a){
if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Proveedores.findById");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Proveedores) q.getResultList().get(0);
}
}
public Proveedores buscarPorNombre(Proveedores a){
if (a.getNombre()== null) {
return null;
}
Query q = em.createNamedQuery("Proveedores.findByNombre");
q.setParameter("nombre", a.getNombre());
List<Proveedores> resultList = q.getResultList();
if(resultList.isEmpty()){
return null;
} else {
return resultList.get(0);
}
}
public Proveedores buscarTodos(Proveedores a){
if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Proveedores.findAll");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Proveedores) q.getResultList().get(0);
}
}
public Proveedores buscarPorCorreo(Proveedores a){
if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Proveedores.findByCorreo");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Proveedores) q.getResultList().get(0);
}
}
public List<Proveedores> buscarPorStatus(short status){
Query q = em.createNamedQuery("Proveedores.findByStatus");
q.setParameter("status", status);
return q.getResultList();
}
public Proveedores buscarPorTipoProducto(Proveedores a){
if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Proveedores.findByTipoProducto");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Proveedores) q.getResultList().get(0);
}
}
public List<Proveedores> getTodos(boolean status){
Query q = em.createNamedQuery("Proveedores.findByStatus");
//q.setParameter("status", 1);
//return q.getResultList();
int s = status?1:0;
q.setParameter("status", s);
return q.getResultList();
}
}

96
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/RolDAO.java

@ -0,0 +1,96 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.dao;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Rol;
/**
*
* @author Ivan Alejandro PC
*/
public class RolDAO {
private EntityManager em; //Manejadro de identidades
public RolDAO() {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Inventario-ejbPU");
em = emf.createEntityManager();
}
/*
Este es un prueba de actualizar
*/
public void agregar(Rol a){
em.getTransaction().begin();//Empezar
em.persist(a);//Almacenar en la BD
em.getTransaction().commit();// terminar
}
public void editar(Rol a){
em.getTransaction().begin();//Empezar
em.merge(a);//Actualizar en la BD
em.getTransaction().commit();// terminar
}
public void eliminar(Rol a){
em.getTransaction().begin();//Empezar
em.remove(em.merge(a));//Eliminar en la BD
em.getTransaction().commit();// terminar
}
public Rol buscarPorRolName(Rol a){
/*if(a.getStatus()==0){
return null;
}*/
if (a.getRolUsuario()== null) {
return null;
}
Query q = em.createNamedQuery("Rol.findByRolUsuario");
q.setParameter("rolUsuario", a.getRolUsuario());
List<Rol> resultList = q.getResultList();
if(resultList.isEmpty()){
return null;
} else {
return resultList.get(0);
}
}
public Rol buscarPorId(Rol a){
if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Rol.findById");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Rol) q.getResultList().get(0);
}
}
public List<Rol> buscarTodos(){
Query q = em.createNamedQuery("Rol.findAll");
return q.getResultList();
}
}

102
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/TallaDAO.java

@ -0,0 +1,102 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.dao;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Talla;
/**
*
* @author Ivan Alejandro PC
*/
public class TallaDAO {
private EntityManager em; //Manejadro de identidades
public TallaDAO() {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Inventario-ejbPU");
em = emf.createEntityManager();
}
/*
Este es un prueba de actualizar
*/
public void agregar(Talla a){
em.getTransaction().begin();//Empezar
em.persist(a);//Almacenar en la BD
em.getTransaction().commit();// terminar
}
public void editar(Talla a){
em.getTransaction().begin();//Empezar
em.merge(a);//Actualizar en la BD
em.getTransaction().commit();// terminar
}
public void eliminar(Talla a){
em.getTransaction().begin();//Empezar
em.remove(em.merge(a));//Eliminar en la BD
em.getTransaction().commit();// terminar
}
public Talla buscarPorId(Talla a){
if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Talla.findById");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Talla) q.getResultList().get(0);
}
}
public Talla buscarPorTalla(Talla a){
if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Talla.findByTalla");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Talla) q.getResultList().get(0);
}
}
public Talla buscarTodos(Talla a){
if (a == null || a.getId()== null) {
return null;
}
Query q = em.createNamedQuery("Talla.findAll");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Talla) q.getResultList().get(0);
}
}
public List<Talla> buscarTodos(){
Query q = em.createNamedQuery("Talla.findAll");
return q.getResultList();
}
}

139
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/UbicacionDAO.java

@ -0,0 +1,139 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.dao;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Ubicacion;
/**
*
* @author Ivan Alejandro PC
*/
public class UbicacionDAO {
private EntityManager em; //Manejadro de identidades
public UbicacionDAO() {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Inventario-ejbPU");
em = emf.createEntityManager();
}
/*
Este es un prueba de actualizar
*/
public void agregar(Ubicacion a){
em.getTransaction().begin();//Empezar
em.persist(a);//Almacenar en la BD
em.getTransaction().commit();// terminar
}
public void editar(Ubicacion a){
em.getTransaction().begin();//Empezar
em.merge(a);//Actualizar en la BD
em.getTransaction().commit();// terminar
}
public void eliminar(Ubicacion a){
em.getTransaction().begin();//Empezar
em.remove(em.merge(a));//Eliminar en la BD
em.getTransaction().commit();// terminar
}
public Ubicacion buscarPorId(Ubicacion a){
if (a != null) {
if (a.getId() == null) {
// Manejar el caso en que el ID sea nulo
return null;
}
if (a == null || a.getId()== null | a.getId() == -1) {
return null;
}
Query q = em.createNamedQuery("Ubicacion.findById");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Ubicacion) q.getResultList().get(0);
}
}else{
return null;
}
}
public Ubicacion buscarPorNombre(Ubicacion a){
/*if(a.getStatus()==0){
return null;
}*/
if (a.getNombreAlmacen()== null) {
return null;
}
Query q = em.createNamedQuery("Ubicacion.findByNombreAlmacen");
q.setParameter("nombreAlmacen", a.getNombreAlmacen());
List<Ubicacion> resultList = q.getResultList();
if(resultList.isEmpty()){
return null;
} else {
return resultList.get(0);
}
}
public Ubicacion buscarPorEstante(Ubicacion a){
/*if(a.getStatus()==0){
return null;
}*/
if (a.getEstante()== null) {
return null;
}
Query q = em.createNamedQuery("Ubicacion.findByEstante");
q.setParameter("estante", a.getEstante());
List<Ubicacion> resultList = q.getResultList();
if(resultList.isEmpty()){
return null;
} else {
return resultList.get(0);
}
}
public Ubicacion buscarPorFila(Ubicacion a){
/*if(a.getStatus()==0){
return null;
}*/
if (a.getFila()== -1 | a.getFila() == 0) {
return null;
}
Query q = em.createNamedQuery("Ubicacion.findByFila");
q.setParameter("fila", a.getFila());
List<Ubicacion> resultList = q.getResultList();
if(resultList.isEmpty()){
return null;
} else {
return resultList.get(0);
}
}
public List<Ubicacion> buscarTodos(){
Query q = em.createNamedQuery("Ubicacion.findAll");
return q.getResultList();
}
}

212
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo/dao/UsuariosDAO.java

@ -0,0 +1,212 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo.dao;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
import mx.edu.tsj.chapala.sistemas.inventario.modelo1.Usuarios;
/**
*
* @author Ivan Alejandro PC
*/
public class UsuariosDAO {
private EntityManager em; //Manejadro de identidades
public UsuariosDAO() {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Inventario-ejbPU");
em = emf.createEntityManager();
}
/*
Este es un prueba de actualizar
*/
public void agregar(Usuarios a){
em.getTransaction().begin();//Empezar
em.persist(a);//Almacenar en la BD
em.getTransaction().commit();// terminar
}
public void editar(Usuarios a){
em.getTransaction().begin();//Empezar
em.merge(a);//Actualizar en la BD
em.getTransaction().commit();// terminar
}
public void activar(Usuarios a){
em.getTransaction().begin();//Empezar
//em.remove(em.merge(a));//Eliminar en la BD
a.setStatus((short)1);
em.merge(a);
em.getTransaction().commit();// terminar
}
public void eliminar(Usuarios a){
em.getTransaction().begin();//Empezar
//em.remove(em.merge(a));//Eliminar en la BD
a.setStatus((short)0);
em.merge(a);
em.getTransaction().commit();// terminar
}
public Usuarios buscarPorId(Usuarios a){
if (a != null) {
// Hacer algo con el objeto
Query q = em.createNamedQuery("Usuarios.findById");
q.setParameter("id", a.getId());
if(q.getResultList().isEmpty()){
return null;
} else {
return (Usuarios) q.getResultList().get(0);
}
} else {
return null;
// El objeto es null, manejar este caso
}
/* if (a == null || a.getId()== null | a.getId() == -1) {
return null;
}*/
}
public Usuarios buscarPorNombre(Usuarios a){
/*if(a.getStatus()==0){
return null;
}*/
if (a.getUsuario() == null) {
return null;
}
Query q = em.createNamedQuery("Usuarios.findByUsuario");
q.setParameter("usuario", a.getUsuario());
List<Usuarios> resultList = q.getResultList();
if(resultList.isEmpty()){
return null;
} else {
return resultList.get(0);
}
}
public List<Usuarios> buscarStatus(short status) {
Query q = em.createNamedQuery("Usuarios.findByStatus");
q.setParameter("status", status);
return q.getResultList();
}
public List<Usuarios> buscarTodos(boolean status){
Query q = em.createNamedQuery("Usuarios.findAll");
int s = status?1:0;
q.setParameter("status", s);
return q.getResultList();
}
//Aqui es un test para crear las validaciones de usuarios
/*public Usuarios validarUsuario(String usuario, String contrasena) {
Usuarios usuarioEncontrado = buscarPorValidaciones(usuario);
if (usuarioEncontrado != null && usuarioEncontrado.getPassword().equals(contrasena)) {
return usuarioEncontrado;
} else {
return null;
}
}
private Usuarios buscarPorValidaciones(String usuario) {
Query q = em.createNamedQuery("Usuarios.validar");
q.setParameter("usuario", usuario);
List<Usuarios> resultList = q.getResultList();
return resultList.isEmpty() ? null : resultList.get(0);
}*/
/*public Usuarios validarUsuario(String usuario, String contrasena) {
Usuarios usuarioEncontrado = buscarPorValidaciones(usuario);
if (usuarioEncontrado != null && usuarioEncontrado.getPassword().equals(contrasena)) {
return usuarioEncontrado;
} else {
return null;
}
}
private Usuarios buscarPorValidaciones(String usuario) {
Query q = em.createNamedQuery("Usuarios.validar");
q.setParameter("usuario", usuario);
List<Usuarios> resultList = q.getResultList();
return resultList.isEmpty() ? null : resultList.get(0);
}
*/
//Test para validar el login
public Usuarios buscarLogin(boolean status, String username, String password) {
if (username == null) {
return null;
}
Query q = em.createNamedQuery("Usuarios.validar");
int s = status ? 1 : 0;
q.setParameter("status", s);
q.setParameter("usuario", username);
q.setParameter("password", password);
List<Usuarios> resultList = q.getResultList();
if (resultList.isEmpty()) {
return null;
} else {
return resultList.get(0); // Devuelve el primer elemento de la lista
}
}
/*public List<Usuarios> buscarLogin(boolean status, Usuarios a){
if (a.getUsuario() == null) {
return null;
}
Query q = em.createNamedQuery("Usuarios.validar");
int s = status?1:0;
q.setParameter("status", s);
q.setParameter("usuario", a.getUsuario());
q.setParameter("password", a.getPassword());
List<Usuarios> resultList = q.getResultList();
if(resultList.isEmpty()){
return null;
} else {
//return resultList.get(0);
return q.getResultList();
}
//return q.getResultList();
}
*/
public Usuarios buscarPorLoginV2(String username, String password) {
if (username == null || password == null) {
return null;
}
Query q = em.createNamedQuery("Usuarios.login");
q.setParameter("usuario", username);
q.setParameter("password", password);
List<Usuarios> resultList = q.getResultList();
if (resultList.isEmpty()) {
return null;
} else {
return resultList.get(0); // Suponiendo que el nombre de usuario es único
}
}
}

125
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Categoria.java

@ -0,0 +1,125 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo1;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author Ivan Alejandro PC
*/
@Entity
@Table(name = "categoria")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Categoria.findAll", query = "SELECT c FROM Categoria c"),
@NamedQuery(name = "Categoria.findById", query = "SELECT c FROM Categoria c WHERE c.id = :id"),
@NamedQuery(name = "Categoria.findByCategoria", query = "SELECT c FROM Categoria c WHERE c.categoria = :categoria")})
public class Categoria implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "categoria")
private String categoria;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "categoriaid")
private Collection<Proveedores> proveedoresCollection;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "categoriaid")
private Collection<Productos> productosCollection;
public Categoria() {
}
public Categoria(Integer id) {
this.id = id;
}
public Categoria(Integer id, String categoria) {
this.id = id;
this.categoria = categoria;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCategoria() {
return categoria;
}
public void setCategoria(String categoria) {
this.categoria = categoria;
}
@XmlTransient
public Collection<Proveedores> getProveedoresCollection() {
return proveedoresCollection;
}
public void setProveedoresCollection(Collection<Proveedores> proveedoresCollection) {
this.proveedoresCollection = proveedoresCollection;
}
@XmlTransient
public Collection<Productos> getProductosCollection() {
return productosCollection;
}
public void setProductosCollection(Collection<Productos> productosCollection) {
this.productosCollection = productosCollection;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Categoria)) {
return false;
}
Categoria other = (Categoria) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "mx.edu.tsj.chapala.sistemas.inventario.modelo1.Categoria[ id=" + id + " ]";
}
}

114
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Color.java

@ -0,0 +1,114 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo1;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author Ivan Alejandro PC
*/
@Entity
@Table(name = "color")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Color.findAll", query = "SELECT c FROM Color c"),
@NamedQuery(name = "Color.findById", query = "SELECT c FROM Color c WHERE c.id = :id"),
@NamedQuery(name = "Color.findByColor", query = "SELECT c FROM Color c WHERE c.color = :color")})
public class Color implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "color")
private String color;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "colorid")
private Collection<Productos> productosCollection;
public Color() {
}
public Color(Integer id) {
this.id = id;
}
public Color(Integer id, String color) {
this.id = id;
this.color = color;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
@XmlTransient
public Collection<Productos> getProductosCollection() {
return productosCollection;
}
public void setProductosCollection(Collection<Productos> productosCollection) {
this.productosCollection = productosCollection;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Color)) {
return false;
}
Color other = (Color) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "mx.edu.tsj.chapala.sistemas.inventario.modelo1.Color[ id=" + id + " ]";
}
}

114
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Genero.java

@ -0,0 +1,114 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo1;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author Ivan Alejandro PC
*/
@Entity
@Table(name = "genero")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Genero.findAll", query = "SELECT g FROM Genero g"),
@NamedQuery(name = "Genero.findById", query = "SELECT g FROM Genero g WHERE g.id = :id"),
@NamedQuery(name = "Genero.findByGenero", query = "SELECT g FROM Genero g WHERE g.genero = :genero")})
public class Genero implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "genero")
private String genero;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "generoid")
private Collection<Productos> productosCollection;
public Genero() {
}
public Genero(Integer id) {
this.id = id;
}
public Genero(Integer id, String genero) {
this.id = id;
this.genero = genero;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getGenero() {
return genero;
}
public void setGenero(String genero) {
this.genero = genero;
}
@XmlTransient
public Collection<Productos> getProductosCollection() {
return productosCollection;
}
public void setProductosCollection(Collection<Productos> productosCollection) {
this.productosCollection = productosCollection;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Genero)) {
return false;
}
Genero other = (Genero) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "mx.edu.tsj.chapala.sistemas.inventario.modelo1.Genero[ id=" + id + " ]";
}
}

114
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Marca.java

@ -0,0 +1,114 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo1;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author Ivan Alejandro PC
*/
@Entity
@Table(name = "marca")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Marca.findAll", query = "SELECT m FROM Marca m"),
@NamedQuery(name = "Marca.findById", query = "SELECT m FROM Marca m WHERE m.id = :id"),
@NamedQuery(name = "Marca.findByMarca", query = "SELECT m FROM Marca m WHERE m.marca = :marca")})
public class Marca implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "marca")
private String marca;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "marcaid")
private Collection<Productos> productosCollection;
public Marca() {
}
public Marca(Integer id) {
this.id = id;
}
public Marca(Integer id, String marca) {
this.id = id;
this.marca = marca;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getMarca() {
return marca;
}
public void setMarca(String marca) {
this.marca = marca;
}
@XmlTransient
public Collection<Productos> getProductosCollection() {
return productosCollection;
}
public void setProductosCollection(Collection<Productos> productosCollection) {
this.productosCollection = productosCollection;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Marca)) {
return false;
}
Marca other = (Marca) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "mx.edu.tsj.chapala.sistemas.inventario.modelo1.Marca[ id=" + id + " ]";
}
}

251
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Productos.java

@ -0,0 +1,251 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo1;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author Ivan Alejandro PC
*/
@Entity
@Table(name = "productos")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Productos.findAll", query = "SELECT p FROM Productos p"),
@NamedQuery(name = "Productos.findById", query = "SELECT p FROM Productos p WHERE p.id = :id"),
@NamedQuery(name = "Productos.findByNombre", query = "SELECT p FROM Productos p WHERE p.nombre = :nombre"),
@NamedQuery(name = "Productos.findByDescripcion", query = "SELECT p FROM Productos p WHERE p.descripcion = :descripcion"),
@NamedQuery(name = "Productos.findByPrecio", query = "SELECT p FROM Productos p WHERE p.precio = :precio"),
@NamedQuery(name = "Productos.findByMaterial", query = "SELECT p FROM Productos p WHERE p.material = :material"),
@NamedQuery(name = "Productos.findByExistencia", query = "SELECT p FROM Productos p WHERE p.existencia = :existencia"),
@NamedQuery(name = "Productos.findByStatus", query = "SELECT p FROM Productos p WHERE p.status = :status")})
public class Productos implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "nombre")
private String nombre;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 100)
@Column(name = "descripcion")
private String descripcion;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "precio")
private String precio;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "material")
private String material;
@Basic(optional = false)
@NotNull
@Column(name = "existencia")
private int existencia;
@Basic(optional = false)
@NotNull
@Column(name = "status")
private short status;
@JoinColumn(name = "Categoria_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private Categoria categoriaid;
@JoinColumn(name = "Color_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private Color colorid;
@JoinColumn(name = "Genero_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private Genero generoid;
@JoinColumn(name = "Marca_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private Marca marcaid;
@JoinColumn(name = "Proveedores_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private Proveedores proveedoresid;
@JoinColumn(name = "Talla_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private Talla tallaid;
@JoinColumn(name = "Ubicacion_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private Ubicacion ubicacionid;
public Productos() {
}
public Productos(Integer id) {
this.id = id;
}
public Productos(Integer id, String nombre, String descripcion, String precio, String material, int existencia, short status) {
this.id = id;
this.nombre = nombre;
this.descripcion = descripcion;
this.precio = precio;
this.material = material;
this.existencia = existencia;
this.status = status;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getDescripcion() {
return descripcion;
}
public void setDescripcion(String descripcion) {
this.descripcion = descripcion;
}
public String getPrecio() {
return precio;
}
public void setPrecio(String precio) {
this.precio = precio;
}
public String getMaterial() {
return material;
}
public void setMaterial(String material) {
this.material = material;
}
public int getExistencia() {
return existencia;
}
public void setExistencia(int existencia) {
this.existencia = existencia;
}
public short getStatus() {
return status;
}
public void setStatus(short status) {
this.status = status;
}
public Categoria getCategoriaid() {
return categoriaid;
}
public void setCategoriaid(Categoria categoriaid) {
this.categoriaid = categoriaid;
}
public Color getColorid() {
return colorid;
}
public void setColorid(Color colorid) {
this.colorid = colorid;
}
public Genero getGeneroid() {
return generoid;
}
public void setGeneroid(Genero generoid) {
this.generoid = generoid;
}
public Marca getMarcaid() {
return marcaid;
}
public void setMarcaid(Marca marcaid) {
this.marcaid = marcaid;
}
public Proveedores getProveedoresid() {
return proveedoresid;
}
public void setProveedoresid(Proveedores proveedoresid) {
this.proveedoresid = proveedoresid;
}
public Talla getTallaid() {
return tallaid;
}
public void setTallaid(Talla tallaid) {
this.tallaid = tallaid;
}
public Ubicacion getUbicacionid() {
return ubicacionid;
}
public void setUbicacionid(Ubicacion ubicacionid) {
this.ubicacionid = ubicacionid;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Productos)) {
return false;
}
Productos other = (Productos) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "mx.edu.tsj.chapala.sistemas.inventario.modelo1.Productos[ id=" + id + " ]";
}
}

213
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Proveedores.java

@ -0,0 +1,213 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo1;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
@Entity
@Table(name = "proveedores")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Proveedores.findAll", query = "SELECT p FROM Proveedores p"),
@NamedQuery(name = "Proveedores.findById", query = "SELECT p FROM Proveedores p WHERE p.id = :id"),
@NamedQuery(name = "Proveedores.findByNombre", query = "SELECT p FROM Proveedores p WHERE p.nombre = :nombre"),
@NamedQuery(name = "Proveedores.findByCorreo", query = "SELECT p FROM Proveedores p WHERE p.correo = :correo"),
@NamedQuery(name = "Proveedores.findByDireccion", query = "SELECT p FROM Proveedores p WHERE p.direccion = :direccion"),
@NamedQuery(name = "Proveedores.findByPais", query = "SELECT p FROM Proveedores p WHERE p.pais = :pais"),
@NamedQuery(name = "Proveedores.findByCiudad", query = "SELECT p FROM Proveedores p WHERE p.ciudad = :ciudad"),
@NamedQuery(name = "Proveedores.findByEstado", query = "SELECT p FROM Proveedores p WHERE p.estado = :estado"),
@NamedQuery(name = "Proveedores.findByTelefono", query = "SELECT p FROM Proveedores p WHERE p.telefono = :telefono"),
@NamedQuery(name = "Proveedores.findByStatus", query = "SELECT p FROM Proveedores p WHERE p.status = :status")})
public class Proveedores implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 255)
@Column(name = "nombre")
private String nombre;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 70)
@Column(name = "correo")
private String correo;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 100)
@Column(name = "direccion")
private String direccion;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 40)
@Column(name = "pais")
private String pais;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "ciudad")
private String ciudad;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "estado")
private String estado;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 20)
@Column(name = "telefono")
private String telefono;
@Basic(optional = false)
@NotNull
@Column(name = "status")
private short status;
@JoinColumn(name = "Categoria_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private Categoria categoriaid;
public Proveedores() {
}
public Proveedores(Integer id) {
this.id = id;
}
public Proveedores(Integer id, String nombre, String correo, String direccion, String pais, String ciudad, String estado, String telefono, short status) {
this.id = id;
this.nombre = nombre;
this.correo = correo;
this.direccion = direccion;
this.pais = pais;
this.ciudad = ciudad;
this.estado = estado;
this.telefono = telefono;
this.status = status;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getCorreo() {
return correo;
}
public void setCorreo(String correo) {
this.correo = correo;
}
public String getDireccion() {
return direccion;
}
public void setDireccion(String direccion) {
this.direccion = direccion;
}
public String getPais() {
return pais;
}
public void setPais(String pais) {
this.pais = pais;
}
public String getCiudad() {
return ciudad;
}
public void setCiudad(String ciudad) {
this.ciudad = ciudad;
}
public String getEstado() {
return estado;
}
public void setEstado(String estado) {
this.estado = estado;
}
public String getTelefono() {
return telefono;
}
public void setTelefono(String telefono) {
this.telefono = telefono;
}
public short getStatus() {
return status;
}
public void setStatus(short status) {
this.status = status;
}
public Categoria getCategoriaid() {
return categoriaid;
}
public void setCategoriaid(Categoria categoriaid) {
this.categoriaid = categoriaid;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Proveedores)) {
return false;
}
Proveedores other = (Proveedores) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "mx.edu.tsj.chapala.sistemas.inventario.modelo1.Proveedores[ id=" + id + " ]";
}
}

114
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Rol.java

@ -0,0 +1,114 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo1;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author Ivan Alejandro PC
*/
@Entity
@Table(name = "rol")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Rol.findAll", query = "SELECT r FROM Rol r"),
@NamedQuery(name = "Rol.findById", query = "SELECT r FROM Rol r WHERE r.id = :id"),
@NamedQuery(name = "Rol.findByRolUsuario", query = "SELECT r FROM Rol r WHERE r.rolUsuario = :rolUsuario")})
public class Rol implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "rolUsuario")
private String rolUsuario;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "rolid")
private Collection<Usuarios> usuariosCollection;
public Rol() {
}
public Rol(Integer id) {
this.id = id;
}
public Rol(Integer id, String rolUsuario) {
this.id = id;
this.rolUsuario = rolUsuario;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getRolUsuario() {
return rolUsuario;
}
public void setRolUsuario(String rolUsuario) {
this.rolUsuario = rolUsuario;
}
@XmlTransient
public Collection<Usuarios> getUsuariosCollection() {
return usuariosCollection;
}
public void setUsuariosCollection(Collection<Usuarios> usuariosCollection) {
this.usuariosCollection = usuariosCollection;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Rol)) {
return false;
}
Rol other = (Rol) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "mx.edu.tsj.chapala.sistemas.inventario.modelo1.Rol[ id=" + id + " ]";
}
}

114
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Talla.java

@ -0,0 +1,114 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo1;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author Ivan Alejandro PC
*/
@Entity
@Table(name = "talla")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Talla.findAll", query = "SELECT t FROM Talla t"),
@NamedQuery(name = "Talla.findById", query = "SELECT t FROM Talla t WHERE t.id = :id"),
@NamedQuery(name = "Talla.findByTalla", query = "SELECT t FROM Talla t WHERE t.talla = :talla")})
public class Talla implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 10)
@Column(name = "talla")
private String talla;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "tallaid")
private Collection<Productos> productosCollection;
public Talla() {
}
public Talla(Integer id) {
this.id = id;
}
public Talla(Integer id, String talla) {
this.id = id;
this.talla = talla;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getTalla() {
return talla;
}
public void setTalla(String talla) {
this.talla = talla;
}
@XmlTransient
public Collection<Productos> getProductosCollection() {
return productosCollection;
}
public void setProductosCollection(Collection<Productos> productosCollection) {
this.productosCollection = productosCollection;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Talla)) {
return false;
}
Talla other = (Talla) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "mx.edu.tsj.chapala.sistemas.inventario.modelo1.Talla[ id=" + id + " ]";
}
}

143
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Ubicacion.java

@ -0,0 +1,143 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo1;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author Ivan Alejandro PC
*/
@Entity
@Table(name = "ubicacion")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Ubicacion.findAll", query = "SELECT u FROM Ubicacion u"),
@NamedQuery(name = "Ubicacion.findById", query = "SELECT u FROM Ubicacion u WHERE u.id = :id"),
@NamedQuery(name = "Ubicacion.findByNombreAlmacen", query = "SELECT u FROM Ubicacion u WHERE u.nombreAlmacen = :nombreAlmacen"),
@NamedQuery(name = "Ubicacion.findByEstante", query = "SELECT u FROM Ubicacion u WHERE u.estante = :estante"),
@NamedQuery(name = "Ubicacion.findByFila", query = "SELECT u FROM Ubicacion u WHERE u.fila = :fila")})
public class Ubicacion implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 255)
@Column(name = "nombreAlmacen")
private String nombreAlmacen;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 100)
@Column(name = "estante")
private String estante;
@Basic(optional = false)
@NotNull
@Column(name = "fila")
private int fila;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "ubicacionid")
private Collection<Productos> productosCollection;
public Ubicacion() {
}
public Ubicacion(Integer id) {
this.id = id;
}
public Ubicacion(Integer id, String nombreAlmacen, String estante, int fila) {
this.id = id;
this.nombreAlmacen = nombreAlmacen;
this.estante = estante;
this.fila = fila;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNombreAlmacen() {
return nombreAlmacen;
}
public void setNombreAlmacen(String nombreAlmacen) {
this.nombreAlmacen = nombreAlmacen;
}
public String getEstante() {
return estante;
}
public void setEstante(String estante) {
this.estante = estante;
}
public int getFila() {
return fila;
}
public void setFila(int fila) {
this.fila = fila;
}
@XmlTransient
public Collection<Productos> getProductosCollection() {
return productosCollection;
}
public void setProductosCollection(Collection<Productos> productosCollection) {
this.productosCollection = productosCollection;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Ubicacion)) {
return false;
}
Ubicacion other = (Ubicacion) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "mx.edu.tsj.chapala.sistemas.inventario.modelo1.Ubicacion[ id=" + id + " ]";
}
}

177
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/modelo1/Usuarios.java

@ -0,0 +1,177 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.modelo1;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author Ivan Alejandro PC
*/
@Entity
@Table(name = "usuarios")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Usuarios.findAll", query = "SELECT u FROM Usuarios u"),
@NamedQuery(name = "Usuarios.findById", query = "SELECT u FROM Usuarios u WHERE u.id = :id"),
@NamedQuery(name = "Usuarios.findByUsuario", query = "SELECT u FROM Usuarios u WHERE u.usuario = :usuario"),
@NamedQuery(name = "Usuarios.findByPassword", query = "SELECT u FROM Usuarios u WHERE u.password = :password"),
@NamedQuery(name = "Usuarios.findByFechaRegistro", query = "SELECT u FROM Usuarios u WHERE u.fechaRegistro = :fechaRegistro"),
@NamedQuery(name = "Usuarios.findBySexo", query = "SELECT u FROM Usuarios u WHERE u.sexo = :sexo"),
@NamedQuery(name = "Usuarios.findByStatus", query = "SELECT u FROM Usuarios u WHERE u.status = :status"),
@NamedQuery(name = "Usuarios.validar", query = "SELECT u FROM Usuarios u WHERE u.status = :status and u.usuario = :usuario and u.password = :password"),
@NamedQuery(name = "Usuarios.login", query = "SELECT u FROM Usuarios u WHERE u.usuario = :usuario and u.password = :password")})
public class Usuarios implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "usuario")
private String usuario;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "password")
private String password;
@Basic(optional = false)
@NotNull
@Column(name = "fechaRegistro")
@Temporal(TemporalType.DATE)
private Date fechaRegistro;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "sexo")
private String sexo;
@Basic(optional = false)
@NotNull
@Column(name = "status")
private short status;
@JoinColumn(name = "Rol_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private Rol rolid;
public Usuarios() {
}
public Usuarios(Integer id) {
this.id = id;
}
public Usuarios(Integer id, String usuario, String password, Date fechaRegistro, String sexo, short status) {
this.id = id;
this.usuario = usuario;
this.password = password;
this.fechaRegistro = fechaRegistro;
this.sexo = sexo;
this.status = status;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUsuario() {
return usuario;
}
public void setUsuario(String usuario) {
this.usuario = usuario;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Date getFechaRegistro() {
return fechaRegistro;
}
public void setFechaRegistro(Date fechaRegistro) {
this.fechaRegistro = fechaRegistro;
}
public String getSexo() {
return sexo;
}
public void setSexo(String sexo) {
this.sexo = sexo;
}
public short getStatus() {
return status;
}
public void setStatus(short status) {
this.status = status;
}
public Rol getRolid() {
return rolid;
}
public void setRolid(Rol rolid) {
this.rolid = rolid;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Usuarios)) {
return false;
}
Usuarios other = (Usuarios) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "mx.edu.tsj.chapala.sistemas.inventario.modelo1.Usuarios[ id=" + id + " ]";
}
}

20
Inventario-ejb/src/java/mx/edu/tsj/chapala/sistemas/inventario/msg/Mensaje.java

@ -0,0 +1,20 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package mx.edu.tsj.chapala.sistemas.inventario.msg;
/**
*
* @author Ivan Alejandro PC
*/
public enum Mensaje {
//Erroes genrales que se va a dar en la app
SIN_ERROR,
CAMPOS_INCOMPLETOS,
DATOS_INCORRECTOS,
ELEMENTO_DUPLICADO,
ELEMENTO_NO_ENCONTRADO,
AUTOR_O_EDITORIAL_INCOMPLETOS,
}

61
build.xml

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="Inventario" default="default" basedir="." xmlns:ear="http://www.netbeans.org/ns/j2ee-earproject/2">
<description>Builds, tests, and runs the project Inventario.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
pre-init: called before initialization of project properties
post-init: called after initialization of project properties
pre-compile: called before javac compilation
post-compile: called after javac compilation
pre-dist: called before archive building
post-dist: called after archive building
post-clean: called after cleaning build products
pre-run-deploy: called before deploying
post-run-deploy: called after deploying
Example of pluging an obfuscator after the compilation could look like
<target name="post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Other way how to customize the build is by overriding existing main targets.
The target of interest are:
do-dist: archive building
run: execution of project
Example of overriding the target for project execution could look like
<target name="run" depends="<PROJNAME>-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that overridden target depends on jar target and not only on
compile target as regular run target does. Again, for list of available
properties which you can use check the target you are overriding in
nbproject/build-impl.xml file.
-->
</project>

131
nbproject/ant-deploy.xml

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project default="-deploy-ant" basedir=".">
<target name="-init-cl-deployment-env" if="deploy.ant.enabled">
<property file="${deploy.ant.properties.file}" />
<available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/>
<available file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" property="glassfish.web.present"/>
<available file="${deploy.ant.resource.dir}" property="has.setup"/>
<tempfile prefix="gfv3" property="gfv3.password.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<echo message="AS_ADMIN_PASSWORD=${gfv3.password}" file="${gfv3.password.file}"/>
</target>
<target name="-parse-sun-web" depends="-init-cl-deployment-env" if="sun.web.present">
<tempfile prefix="gfv3" property="temp.sun.web" destdir="${java.io.tmpdir}"/>
<copy file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" tofile="${temp.sun.web}"/>
<!-- The doctype triggers resolution which can fail -->
<replace file="${temp.sun.web}">
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken>
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue>
</replace>
<replace file="${temp.sun.web}">
<replacetoken><![CDATA[<sun-web-app]]></replacetoken>
<replacevalue><![CDATA[--> <sun-web-app]]></replacevalue>
</replace>
<xmlproperty file="${temp.sun.web}" validate="false">
</xmlproperty>
<delete file="${temp.sun.web}"/>
<condition property="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}" else="${gfv3.url}/${ant.project.name}">
<isset property="sun-web-app.context-root"/>
</condition>
<condition property="deploy.context.root.argument" value="&amp;contextroot=${sun-web-app.context-root}" else="/${ant.project.name}">
<isset property="sun-web-app.context-root"/>
</condition>
</target>
<target name="-parse-glassfish-web" depends="-init-cl-deployment-env" if="glassfish.web.present">
<tempfile prefix="gfv3" property="temp.gf.web" destdir="${java.io.tmpdir}"/>
<copy file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" tofile="${temp.gf.web}"/>
<!-- The doctype triggers resolution which can fail -->
<replace file="${temp.gf.web}">
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken>
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue>
</replace>
<replace file="${temp.gf.web}">
<replacetoken><![CDATA[<glassfish-web-app]]></replacetoken>
<replacevalue><![CDATA[--> <glassfish-web-app]]></replacevalue>
</replace>
<xmlproperty file="${temp.gf.web}" validate="false">
</xmlproperty>
<delete file="${temp.gf.web}"/>
<condition property="deploy.ant.client.url" value="${gfv3.url}${glassfish-web-app.context-root}" else="${gfv3.url}/${ant.project.name}">
<isset property="glassfish-web-app.context-root"/>
</condition>
<condition property="deploy.context.root.argument" value="&amp;contextroot=${glassfish-web-app.context-root}" else="/${ant.project.name}">
<isset property="glassfish-web-app.context-root"/>
</condition>
</target>
<target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present">
<property name="deploy.context.root.argument" value=""/>
</target>
<target name="-add-resources" depends="-init-cl-deployment-env" if="has.setup">
<tempfile prefix="gfv3" property="gfv3.resources.dir" destdir="${java.io.tmpdir}"/>
<mkdir dir="${gfv3.resources.dir}"/>
<mkdir dir="${gfv3.resources.dir}/META-INF"/>
<copy todir="${gfv3.resources.dir}/META-INF">
<fileset dir="${deploy.ant.resource.dir}"/>
</copy>
<jar destfile="${deploy.ant.archive}" update="true">
<fileset dir="${gfv3.resources.dir}"/>
</jar>
<delete dir="${gfv3.resources.dir}"/>
</target>
<target name="-deploy-ant" depends="-parse-glassfish-web, -parse-sun-web, -no-parse-sun-web,-add-resources" if="deploy.ant.enabled">
<antcall target="-deploy-without-pw"/>
<antcall target="-deploy-with-pw"/>
</target>
<target name="-deploy-without-pw" unless="gfv3.password">
<echo message="Deploying ${deploy.ant.archive}"/>
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/>
<get src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&amp;force=true&amp;name=${ant.project.name}"
dest="${gfv3.results.file}"/>
<delete file="${gfv3.results.file}"/>
</target>
<target name="-deploy-with-pw" if="gfv3.password">
<echo message="Deploying ${deploy.ant.archive}"/>
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/>
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&amp;force=true&amp;name=${ant.project.name}"
dest="${gfv3.results.file}"/>
<delete file="${gfv3.results.file}"/>
</target>
<target name="-undeploy-ant" depends="-init-cl-deployment-env" if="deploy.ant.enabled">
<antcall target="-undeploy-without-pw"/>
<antcall target="-undeploy-with-pw"/>
</target>
<target name="-undeploy-without-pw" unless="gfv3.password">
<echo message="Undeploying ${deploy.ant.archive}"/>
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<get src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}"
dest="${gfv3.results.file}"/>
<delete file="${gfv3.results.file}"/>
</target>
<target name="-undeploy-with-pw" if="gfv3.password">
<echo message="Undeploying ${deploy.ant.archive}"/>
<tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}"
dest="${gfv3.results.file}"/>
<delete file="${gfv3.results.file}"/>
</target>
</project>

635
nbproject/build-impl.xml

@ -0,0 +1,635 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
*** GENERATED FROM project.xml - DO NOT EDIT ***
*** EDIT ../build.xml INSTEAD ***
For the purpose of easier reading the script
is divided into following sections:
- initialization
- compilation
- dist
- execution
- debugging
- cleanup
-->
<project xmlns:ear2="http://www.netbeans.org/ns/j2ee-earproject/2" basedir=".." default="default" name="Inventario-impl">
<import file="ant-deploy.xml"/>
<fail message="Please build using Ant 1.7.1 or higher.">
<condition>
<not>
<antversion atleast="1.7.1"/>
</not>
</condition>
</fail>
<target depends="dist" description="Build whole project." name="default"/>
<!--
INITIALIZATION SECTION
-->
<target name="pre-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="pre-init" name="init-private">
<property file="nbproject/private/private.properties"/>
</target>
<target depends="pre-init,init-private" name="init-userdir">
<property location="${netbeans.user}/build.properties" name="user.properties.file"/>
</target>
<target depends="pre-init,init-private,init-userdir" name="init-user">
<property file="${user.properties.file}"/>
</target>
<target depends="pre-init,init-private,init-userdir,init-user" name="init-project">
<property file="nbproject/project.properties"/>
</target>
<target depends="pre-init,init-private,init-userdir,init-user,init-project" name="do-init">
<!-- The two properties below are usually overridden -->
<!-- by the active platform. Just a fallback. -->
<property name="default.javac.source" value="1.4"/>
<property name="default.javac.target" value="1.4"/>
<condition property="do.compile.jsps">
<istrue value="${compile.jsps}"/>
</condition>
<condition property="do.display.browser.old">
<and>
<istrue value="${display.browser}"/>
<isset property="client.module.uri"/>
<not>
<isset property="app.client"/>
</not>
<not>
<isset property="browser.context"/>
</not>
</and>
</condition>
<condition property="do.display.browser">
<and>
<istrue value="${display.browser}"/>
<isset property="client.module.uri"/>
<not>
<isset property="app.client"/>
</not>
<isset property="browser.context"/>
</and>
</condition>
<available file="${meta.inf}/MANIFEST.MF" property="has.custom.manifest"/>
<!--
Variables needed to support directory deployment.
-->
<condition property="do.package.with.custom.manifest.not.directory.deploy">
<and>
<isset property="has.custom.manifest"/>
<isfalse value="${directory.deployment.supported}"/>
</and>
</condition>
<condition property="do.package.without.custom.manifest.not.directory.deploy">
<and>
<not>
<isset property="has.custom.manifest"/>
</not>
<isfalse value="${directory.deployment.supported}"/>
</and>
</condition>
<condition property="do.package.not.directory.deploy">
<isfalse value="${directory.deployment.supported}"/>
</condition>
<!--End Variables needed to support directory deployment.-->
<condition else="" property="j2ee.appclient.mainclass.tool.param" value="-mainclass ${main.class}">
<and>
<isset property="main.class"/>
<not>
<equals arg1="${main.class}" arg2="" trim="true"/>
</not>
</and>
</condition>
<condition else="" property="j2ee.appclient.jvmoptions.param" value="${j2ee.appclient.jvmoptions}">
<and>
<isset property="j2ee.appclient.jvmoptions"/>
<not>
<equals arg1="${j2ee.appclient.jvmoptions}" arg2="" trim="true"/>
</not>
</and>
</condition>
<condition else="" property="application.args.param" value="${application.args}">
<and>
<isset property="application.args"/>
<not>
<equals arg1="${application.args}" arg2="" trim="true"/>
</not>
</and>
</condition>
<condition property="can.debug.appclient">
<and>
<isset property="netbeans.home"/>
<isset property="app.client"/>
</and>
</condition>
<path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
<condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
<and>
<isset property="endorsed.classpath"/>
<length length="0" string="${endorsed.classpath}" when="greater"/>
</and>
</condition>
</target>
<target depends="init" name="-init-cos">
<condition else="false" property="build.deploy.on.save">
<or>
<istrue value="${j2ee.deploy.on.save}"/>
<istrue value="${j2ee.compile.on.save}"/>
</or>
</condition>
</target>
<target name="post-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="pre-init,init-private,init-userdir,init-user,init-project,do-init" name="init-check">
<fail unless="build.dir">Must set build.dir</fail>
<fail unless="build.generated.dir">Must set build.generated.dir</fail>
<fail unless="dist.dir">Must set dist.dir</fail>
<fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
<fail unless="dist.jar">Must set dist.jar</fail>
</target>
<target name="-init-taskdefs">
<fail unless="libs.CopyLibs.classpath">
The libs.CopyLibs.classpath property is not set up.
This property must point to
org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part
of NetBeans IDE installation and is usually located at
&lt;netbeans_installation&gt;/java&lt;version&gt;/ant/extra folder.
Either open the project in the IDE and make sure CopyLibs library
exists or setup the property manually. For example like this:
ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar
</fail>
<taskdef classpath="${libs.CopyLibs.classpath}" resource="org/netbeans/modules/java/j2seproject/copylibstask/antlib.xml"/>
</target>
<!--
pre NB7.2 profiling section; consider it deprecated
-->
<target depends="-profile-pre-init, init, -profile-post-init, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
<target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target if="profiler.info.jvmargs.agent" name="-profile-post-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="-profile-pre-init, init, -profile-post-init" if="profiler.info.jvmargs.agent" name="-profile-init-check">
<fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
<fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
</target>
<!--
end of pre NB7.2 profiling section
-->
<target depends="pre-init,init-private,init-userdir,init-user,init-project,do-init,post-init,init-check,-init-taskdefs" name="init"/>
<!--
COMPILATION SECTION
-->
<target depends="init" name="deps-jar" unless="no.deps">
<condition property="build.deploy.on.save" value="false">
<not>
<isset property="build.deploy.on.save"/>
</not>
</condition>
</target>
<target depends="init" name="deps-j2ee-archive" unless="no.deps">
<condition property="build.deploy.on.save" value="false">
<not>
<isset property="build.deploy.on.save"/>
</not>
</condition>
<ant antfile="${project.Inventario-ejb}/build.xml" inheritall="false" target="dist-ear">
<property location="${build.dir}" name="dist.ear.dir"/>
<property name="deploy.on.save" value="${build.deploy.on.save}"/>
</ant>
<ant antfile="${project.Inventario-war}/build.xml" inheritall="false" target="dist-ear">
<property location="${build.dir}" name="dist.ear.dir"/>
<property name="deploy.on.save" value="${build.deploy.on.save}"/>
</ant>
</target>
<target depends="init,deps-jar,deps-j2ee-archive" name="pre-pre-compile"/>
<target name="pre-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,deps-jar,pre-pre-compile,pre-compile,-do-compile-deps" name="do-compile">
<copy todir="${build.dir}/META-INF">
<fileset dir="${meta.inf}"/>
</copy>
</target>
<target depends="init,deps-jar,pre-pre-compile,pre-compile" name="-do-compile-deps">
<copyfiles files="${reference.Inventario-war.dist-ear}" todir="${build.dir}//"/>
<copyfiles files="${reference.Inventario-ejb.dist-ear}" todir="${build.dir}//"/>
</target>
<target name="post-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,deps-jar,pre-pre-compile,pre-compile,do-compile,post-compile" description="Compile project." name="compile"/>
<!--
DIST BUILDING SECTION
-->
<target name="pre-dist">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,compile,pre-dist" name="do-dist-without-manifest" unless="has.custom.manifest">
<dirname file="${dist.jar}" property="dist.jar.dir"/>
<mkdir dir="${dist.jar.dir}"/>
<jar compress="${jar.compress}" jarfile="${dist.jar}">
<fileset dir="${build.dir}"/>
</jar>
</target>
<target depends="init,compile,pre-dist" if="has.custom.manifest" name="do-dist-with-manifest">
<dirname file="${dist.jar}" property="dist.jar.dir"/>
<mkdir dir="${dist.jar.dir}"/>
<jar compress="${jar.compress}" jarfile="${dist.jar}" manifest="${meta.inf}/MANIFEST.MF">
<fileset dir="${build.dir}"/>
</jar>
</target>
<!--
TARGETS NEEDED TO SUPPORT DIRECTORY DEPLOYMENT
-->
<target depends="init,compile,pre-dist" if="do.package.without.custom.manifest.not.directory.deploy" name="-do-tmp-dist-without-manifest">
<dirname file="${dist.jar}" property="dist.jar.dir"/>
<mkdir dir="${dist.jar.dir}"/>
<jar compress="${jar.compress}" jarfile="${dist.jar}">
<fileset dir="${build.dir}"/>
</jar>
</target>
<target depends="init,compile,pre-dist" if="do.package.with.custom.manifest.not.directory.deploy" name="-do-tmp-dist-with-manifest">
<dirname file="${dist.jar}" property="dist.jar.dir"/>
<mkdir dir="${dist.jar.dir}"/>
<jar compress="${jar.compress}" jarfile="${dist.jar}" manifest="${meta.inf}/MANIFEST.MF">
<fileset dir="${build.dir}"/>
</jar>
</target>
<target depends="init,compile,pre-dist,-do-tmp-dist-without-manifest,-do-tmp-dist-with-manifest" name="-do-dist-directory-deploy"/>
<target depends="init,compile,pre-dist,-do-dist-directory-deploy,post-dist" description="Build distribution (JAR) - if directory deployment is not supported." name="dist-directory-deploy"/>
<!--
END TARGETS NEEDED TO SUPPORT DIRECTORY DEPLOYMENT
-->
<target name="post-dist">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,compile,pre-dist,do-dist-without-manifest,do-dist-with-manifest,post-dist" description="Build distribution (JAR)." name="dist"/>
<!--
EXECUTION SECTION
-->
<target depends="run-deploy,run-display-browser,run-ac" description="Deploy to server." name="run"/>
<target name="pre-run-deploy">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="post-run-deploy">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-pre-nbmodule-run-deploy">
<!-- Empty placeholder for easier customization. -->
<!-- This target can be overriden by NetBeans modules. Don't override it directly, use -pre-run-deploy task instead. -->
</target>
<target name="-post-nbmodule-run-deploy">
<!-- Empty placeholder for easier customization. -->
<!-- This target can be overriden by NetBeans modules. Don't override it directly, use -post-run-deploy task instead. -->
</target>
<target name="-run-deploy-am" unless="no.deps">
<!-- Task to deploy to the Access Manager runtime. -->
<ant antfile="${project.Inventario-ejb}/build.xml" inheritall="false" target="-run-deploy-am"/>
<ant antfile="${project.Inventario-war}/build.xml" inheritall="false" target="-run-deploy-am"/>
</target>
<target depends="-init-cos,dist-directory-deploy,pre-run-deploy,-pre-nbmodule-run-deploy,-run-deploy-nb,-init-deploy-ant,-deploy-ant,-run-deploy-am,-post-nbmodule-run-deploy,post-run-deploy" name="run-deploy"/>
<target if="netbeans.home" name="-run-deploy-nb">
<nbdeploy clientModuleUri="${client.module.uri}" clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
</target>
<target name="-init-deploy-ant" unless="netbeans.home">
<property name="deploy.ant.archive" value="${dist.jar}"/>
<property name="deploy.ant.resource.dir" value="${resource.dir}"/>
<property name="deploy.ant.enabled" value="true"/>
</target>
<target depends="dist,-run-undeploy-nb,-init-deploy-ant,-undeploy-ant" name="run-undeploy"/>
<target if="netbeans.home" name="-run-undeploy-nb">
<fail message="Undeploy is not supported from within the IDE"/>
</target>
<target depends="dist" name="verify">
<nbverify file="${dist.jar}"/>
</target>
<target depends="run-deploy,-init-display-browser,-display-browser-nb-old,-display-browser-nb,-display-browser-cl" name="run-display-browser"/>
<target if="do.display.browser" name="-init-display-browser">
<condition property="do.display.browser.nb.old">
<and>
<isset property="netbeans.home"/>
<not>
<isset property="browser.context"/>
</not>
</and>
</condition>
<condition property="do.display.browser.nb">
<and>
<isset property="netbeans.home"/>
<isset property="browser.context"/>
</and>
</condition>
<condition property="do.display.browser.cl">
<and>
<isset property="deploy.ant.enabled"/>
<isset property="deploy.ant.client.url"/>
</and>
</condition>
</target>
<target if="do.display.browser.nb.old" name="-display-browser-nb-old">
<nbbrowse url="${client.url}"/>
</target>
<target if="do.display.browser.nb" name="-display-browser-nb">
<nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
</target>
<target if="do.display.browser.cl" name="-get-browser" unless="browser">
<condition property="browser" value="rundll32">
<os family="windows"/>
</condition>
<condition else="" property="browser.args" value="url.dll,FileProtocolHandler">
<os family="windows"/>
</condition>
<condition property="browser" value="/usr/bin/open">
<os family="mac"/>
</condition>
<property environment="env"/>
<condition property="browser" value="${env.BROWSER}">
<isset property="env.BROWSER"/>
</condition>
<condition property="browser" value="/usr/bin/firefox">
<available file="/usr/bin/firefox"/>
</condition>
<condition property="browser" value="/usr/local/firefox/firefox">
<available file="/usr/local/firefox/firefox"/>
</condition>
<condition property="browser" value="/usr/bin/mozilla">
<available file="/usr/bin/mozilla"/>
</condition>
<condition property="browser" value="/usr/local/mozilla/mozilla">
<available file="/usr/local/mozilla/mozilla"/>
</condition>
<condition property="browser" value="/usr/sfw/lib/firefox/firefox">
<available file="/usr/sfw/lib/firefox/firefox"/>
</condition>
<condition property="browser" value="/opt/csw/bin/firefox">
<available file="/opt/csw/bin/firefox"/>
</condition>
<condition property="browser" value="/usr/sfw/lib/mozilla/mozilla">
<available file="/usr/sfw/lib/mozilla/mozilla"/>
</condition>
<condition property="browser" value="/opt/csw/bin/mozilla">
<available file="/opt/csw/bin/mozilla"/>
</condition>
</target>
<target depends="-get-browser" if="do.display.browser.cl" name="-display-browser-cl">
<fail unless="browser">
Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable.
</fail>
<property name="browse.url" value="${deploy.ant.client.url}${client.urlPart}"/>
<echo>Launching ${browse.url}</echo>
<exec executable="${browser}" spawn="true">
<arg line="${browser.args} ${browse.url}"/>
</exec>
</target>
<target if="app.client" name="run-ac">
<antcall target="-run-ac"/>
</target>
<target depends="init,-as-retrieve-option-workaround,-init-run-macros,-run-appclient-pregfv3,-run-appclient" name="-run-ac"/>
<target if="j2ee.appclient.tool.args" name="-run-appclient-pregfv3">
<ear2:run-appclient-pregfv3/>
</target>
<target name="-run-appclient" unless="j2ee.appclient.tool.args">
<ear2:run-appclient subprojectname="${app.client}"/>
</target>
<target if="j2ee.appclient.mainclass.args" name="-as-retrieve-option-workaround" unless="j2ee.clientName">
<property name="client.jar" value="${dist.dir}/InventarioClient.jar"/>
<sleep seconds="3"/>
<copy failonerror="false" file="${wa.copy.client.jar.from}/Inventario/InventarioClient.jar" todir="${dist.dir}"/>
<copy failonerror="false" flatten="true" todir="${dist.dir}/">
<fileset dir="${wa.copy.client.jar.from}/Inventario" includes="**/InventarioClient.jar"/>
</copy>
<copy flatten="true" todir="${dist.dir}/InventarioClient">
<fileset dir="${wa.copy.client.jar.from}/Inventario" includes="**/*.*ar"/>
</copy>
<copy failonerror="false" flatten="false" todir="${dist.dir}/InventarioClient">
<fileset dir="${dist.dir}/gfdeploy/Inventario" includes="**/*.jar"/>
</copy>
</target>
<target depends="init" name="-init-run-macros">
<macrodef name="run-appclient" uri="http://www.netbeans.org/ns/j2ee-earproject/2">
<attribute name="subprojectname"/>
<attribute default="${application.args.param}" name="args"/>
<element name="customize" optional="true"/>
<sequential>
<java dir="${basedir}" fork="true" jar="${client.jar}">
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg line="${j2ee.appclient.tool.jvmoptions}${client.jar},arg=-name,arg=@{subprojectname}"/>
<jvmarg line="${j2ee.appclient.jvmoptions.param}"/>
<arg line="@{args}"/>
<syspropertyset>
<propertyref prefix="run-sys-prop."/>
<mapper from="run-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<customize/>
</java>
</sequential>
</macrodef>
<macrodef name="run-appclient-pregfv3" uri="http://www.netbeans.org/ns/j2ee-earproject/2">
<element name="customize" optional="true"/>
<sequential>
<java classname="${j2ee.appclient.tool.mainclass}" fork="true">
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg line="${j2ee.appclient.tool.jvmoptions}"/>
<jvmarg line="${j2ee.appclient.jvmoptions.param}"/>
<arg line="${j2ee.appclient.tool.args}"/>
<arg line="-client ${client.jar}"/>
<arg line="${j2ee.appclient.mainclass.tool.param}"/>
<arg line="${application.args.param}"/>
<classpath>
<path path="${j2ee.platform.classpath}:${j2ee.appclient.tool.runtime}"/>
</classpath>
<syspropertyset>
<propertyref prefix="run-sys-prop."/>
<mapper from="run-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<customize/>
</java>
</sequential>
</macrodef>
</target>
<!--
DEBUGGING SECTION
-->
<target depends="run-debug,run-debug-appclient" description="Deploy to server." name="debug"/>
<target depends="dist" description="Debug project in IDE." if="netbeans.home" name="run-debug" unless="app.client">
<nbdeploy clientModuleUri="${client.module.uri}" clientUrlPart="${client.urlPart}" debugmode="true"/>
<antcall target="connect-debugger"/>
<antcall target="debug-display-browser-old"/>
<antcall target="debug-display-browser"/>
</target>
<target name="connect-debugger" unless="is.debugged">
<condition property="listeningcp" value="sourcepath">
<istrue value="${j2ee.compile.on.save}"/>
</condition>
<nbjpdaconnect address="${jpda.address}" host="${jpda.host}" listeningcp="${listeningcp}" name="${jpda.host}:${jpda.address}" transport="${jpda.transport}">
<classpath>
<path path="${debug.classpath}"/>
<fileset dir="${build.dir}" includes="lib/*.jar"/>
</classpath>
<sourcepath>
<path path="${ear.docbase.dirs}"/>
</sourcepath>
</nbjpdaconnect>
</target>
<target if="do.display.browser.old" name="debug-display-browser-old">
<nbbrowse url="${client.url}"/>
</target>
<target if="do.display.browser" name="debug-display-browser">
<nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
</target>
<target if="can.debug.appclient" name="run-debug-appclient">
<antcall target="-run-debug-appclient"/>
</target>
<target depends="init,-init-debug-args,-debug-appclient-deploy,-as-retrieve-option-workaround,-init-debug-macros,-debug-appclient-start-nbjpda,-debug-appclient-pregfv3,-debug-appclient,connect-debugger" name="-run-debug-appclient"/>
<target name="-init-debug-args"/>
<target depends="init,-init-debug-args,-as-retrieve-option-workaround,-init-run-macros" name="-init-debug-macros">
<condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
<os family="windows"/>
</condition>
<condition else="${debug-transport-by-os}" property="debug-transport-appclient" value="${debug.transport}">
<isset property="debug.transport"/>
</condition>
<macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2ee-earproject/2">
<attribute default="${main.class}" name="name"/>
<attribute default="${debug.classpath}" name="classpath"/>
<attribute default="" name="stopclassname"/>
<sequential>
<nbjpdastart addressproperty="jpda.address.appclient" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport-appclient}">
<classpath>
<path path="@{classpath}"/>
</classpath>
</nbjpdastart>
</sequential>
</macrodef>
<macrodef name="debug-appclient" uri="http://www.netbeans.org/ns/j2ee-earproject/2">
<attribute name="subprojectname"/>
<sequential>
<ear2:run-appclient subprojectname="@{subprojectname}">
<customize>
<jvmarg value="-agentlib:jdwp=transport=${debug-transport-appclient},address=${jpda.address.appclient}"/>
</customize>
</ear2:run-appclient>
</sequential>
</macrodef>
<macrodef name="debug-appclient-pregfv3" uri="http://www.netbeans.org/ns/j2ee-earproject/2">
<sequential>
<ear2:run-appclient-pregfv3>
<customize>
<jvmarg value="-agentlib:jdwp=transport=${debug-transport-appclient},address=${jpda.address.appclient}"/>
</customize>
</ear2:run-appclient-pregfv3>
</sequential>
</macrodef>
</target>
<target name="-debug-appclient-deploy">
<nbstartserver debugmode="true"/>
<nbdeploy clientModuleUri="${client.module.uri}" clientUrlPart="${client.urlPart}" debugmode="true"/>
</target>
<target name="-debug-appclient-start-nbjpda">
<ear2:nbjpdastart classpath="" name="${app.client}"/>
</target>
<target if="j2ee.appclient.tool.args" name="-debug-appclient-pregfv3">
<ear2:debug-appclient-pregfv3/>
</target>
<target name="-debug-appclient" unless="j2ee.appclient.tool.args">
<ear2:debug-appclient subprojectname="${app.client}"/>
</target>
<!--
=================
PROFILING SECTION
=================
-->
<!--
pre NB7.2 profiling section; consider it deprecated
-->
<target description="Profile a J2EE project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
<condition else="start-profiled-server" property="profiler.startserver.target" value="start-profiled-server-extraargs">
<isset property="profiler.info.jvmargs.extra"/>
</condition>
<antcall target="${profiler.startserver.target}"/>
<antcall target="run"/>
<antcall target="-profile-start-loadgen"/>
</target>
<target name="start-profiled-server">
<nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}">
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg value="${profiler.j2ee.agentID}"/>
</nbstartprofiledserver>
</target>
<target name="start-profiled-server-extraargs">
<nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}">
<jvmarg value="${profiler.info.jvmargs.extra}"/>
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg value="${profiler.j2ee.agentID}"/>
</nbstartprofiledserver>
</target>
<!--
end of pre NB7.2 profiling section
-->
<target if="netbeans.home" name="-profile-check">
<condition property="profiler.configured">
<or>
<contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
<contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
</or>
</condition>
</target>
<target depends="dist" name="-do-profile">
<startprofiler/>
<nbstartserver profilemode="true"/>
<nbdeploy clientUrlPart="${client.urlPart}" forceRedeploy="true" profilemode="true"/>
<antcall target="-profile-start-loadgen"/>
</target>
<target depends="-profile-check,-profile-pre72" description="Profile a J2EE project in the IDE." if="profiler.configured" name="profile">
<antcall target="-do-profile"/>
</target>
<target if="profiler.loadgen.path" name="-profile-start-loadgen">
<loadgenstart path="${profiler.loadgen.path}"/>
</target>
<!--
CLEANUP SECTION
-->
<target depends="init" name="deps-clean" unless="no.deps">
<condition property="build.deploy.on.save" value="false">
<not>
<isset property="build.deploy.on.save"/>
</not>
</condition>
<ant antfile="${project.Inventario-ejb}/build.xml" inheritall="false" target="clean-ear">
<property location="${build.dir}" name="dist.ear.dir"/>
<property name="deploy.on.save" value="${build.deploy.on.save}"/>
</ant>
<ant antfile="${project.Inventario-war}/build.xml" inheritall="false" target="clean-ear">
<property location="${build.dir}" name="dist.ear.dir"/>
<property name="deploy.on.save" value="${build.deploy.on.save}"/>
</ant>
</target>
<target depends="init" name="do-clean">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${build.dir}"/>
</target>
<target depends="init" if="netbeans.home" name="undeploy-clean">
<nbundeploy failOnError="false" startServer="false"/>
</target>
<target name="post-clean">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,undeploy-clean,deps-clean,do-clean,post-clean" description="Clean build products." name="clean"/>
</project>

8
nbproject/genfiles.properties

@ -0,0 +1,8 @@
build.xml.data.CRC32=c2bbad60
build.xml.script.CRC32=b95b2ece
build.xml.stylesheet.CRC32=7e2ae9c8@1.73
# 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=c2bbad60
nbproject/build-impl.xml.script.CRC32=8a3446c7
nbproject/build-impl.xml.stylesheet.CRC32=abdce74a@1.73

40
nbproject/project.properties

@ -0,0 +1,40 @@
build.classes.excludes=**/*.java,**/*.form,**/.nbattrs
build.dir=build
build.generated.dir=${build.dir}/generated
client.module.uri=Inventario-war
client.urlPart=
debug.classpath=${javac.classpath}::${jar.content.additional}:${run.classpath}
display.browser=true
dist.dir=dist
dist.jar=${dist.dir}/${jar.name}
endorsed.classpath=\
${libs.javaee-endorsed-api-7.0.classpath}
j2ee.appclient.mainclass.args=${j2ee.appclient.tool.args}
j2ee.compile.on.save=true
j2ee.deploy.on.save=true
j2ee.platform=1.7
j2ee.platform.classpath=
j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar
j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar
j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar
j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar
j2ee.platform.wsit.classpath=
j2ee.server.type=gfv4ee7
jar.compress=false
jar.content.additional=\
${reference.Inventario-war.dist-ear}:\
${reference.Inventario-ejb.dist-ear}
jar.name=Inventario.ear
javac.debug=true
javac.deprecation=false
javac.source=1.7
javac.target=1.7
meta.inf=src/conf
no.dependencies=false
platform.active=default_platform
project.Inventario-ejb=Inventario-ejb
project.Inventario-war=Inventario-war
reference.Inventario-ejb.dist-ear=${project.Inventario-ejb}/dist/Inventario-ejb.jar
reference.Inventario-war.dist-ear=${project.Inventario-war}/dist/Inventario-war.war
resource.dir=setup
source.root=.

39
nbproject/project.xml

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.j2ee.earproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2ee-earproject/2">
<name>Inventario</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<web-module-libraries/>
<web-module-additional-libraries>
<library>
<file>${reference.Inventario-war.dist-ear}</file>
<path-in-war>/</path-in-war>
</library>
<library>
<file>${reference.Inventario-ejb.dist-ear}</file>
<path-in-war>/</path-in-war>
</library>
</web-module-additional-libraries>
</data>
<references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
<reference>
<foreign-project>Inventario-ejb</foreign-project>
<artifact-type>j2ee_ear_archive</artifact-type>
<script>build.xml</script>
<target>dist-ear</target>
<clean-target>clean-ear</clean-target>
<id>dist-ear</id>
</reference>
<reference>
<foreign-project>Inventario-war</foreign-project>
<artifact-type>j2ee_ear_archive</artifact-type>
<script>build.xml</script>
<target>dist-ear</target>
<clean-target>clean-ear</clean-target>
<id>dist-ear</id>
</reference>
</references>
</configuration>
</project>

2
src/conf/MANIFEST.MF

@ -0,0 +1,2 @@
Manifest-Version: 1.0
Loading…
Cancel
Save