Skip to content

Instantly share code, notes, and snippets.

Avatar

Richard Osmar Leon Ingaruca jrichardsz

View GitHub Profile
View public class Cliente
package com.empresa.modelo;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "cliente")
public class Cliente {
@jrichardsz
jrichardsz / Ant desplegar War openxava
Last active Feb 5, 2017
Cambios en el ant por defecto de openxava para poder generar un war del proyecto.
View Ant desplegar War openxava
This:
<target name="deployWar">
<!-- In a directory -->
<ant antfile="../OpenXava/build.xml" target="deploy"/>
<!-- In a file (it does not work well on windows + tomcat)
<ant antfile="../OpenXava/build.xml" target="deployWar"/>
-->
</target>
@jrichardsz
jrichardsz / Log de exito al generar el war openxava
Created Oct 13, 2013
Log de exito al generar el war openxava
View Log de exito al generar el war openxava
Buildfile: x:\tutoriales\demos\openxava\workspace\eclipse\openxava-4.8\openxava-4.8\workspace\Empresa\build.xml
desplegarWar:
createDist:
init:
updateDataSourceInfo:
configureJNDI:
prepareWar:
[copy] Copying 700 files to x:\tutoriales\demos\openxava\workspace\eclipse\openxava-4.8\openxava-4.8\workspace\Empresa\web\xava
[copy] Copying 47 files to x:\tutoriales\demos\openxava\workspace\eclipse\openxava-4.8\openxava-4.8\workspace\Empresa\web\WEB-INF
createWebXml:
@jrichardsz
jrichardsz / persistence.xml
Created Oct 13, 2013
Configuracion del archivo persistence.xml
View persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<!-- Tomcat + Hypersonic -->
<persistence-unit name="default">
@jrichardsz
jrichardsz / hibernate.cfg.xml
Last active Dec 25, 2015
Configuracion del archivo hibernate.cfg.xml
View hibernate.cfg.xml
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<!--
This hibernate configuration is used only for IMAGES_GALLERY stereotype,
because this stereotype is implemented using hibernate native APIs.
If you do not use IMAGE_GALLERY you do not need this file.
The datasource configured here is the datasource in where the images will be
@jrichardsz
jrichardsz / context.xml
Last active Dec 25, 2015
Datasource Tomcat usado por la aplicacion para conectarse a la base de datos.
View context.xml
<?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
@jrichardsz
jrichardsz / Cambios Persistence.xml
Last active Feb 5, 2017
Cambios en el archivo Persistence.xml
View Cambios Persistence.xml
A.- Dialect :
This:
<persistence-unit name="default">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<non-jta-data-source>java:comp/env/jdbc/MySchoolDS</non-jta-data-source>
<class>org.openxava.session.GalleryImage</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
@jrichardsz
jrichardsz / Cambios hibernate.cfg.xml
Last active Feb 5, 2017
Cambios en el archivo hibernate.cfg.xml
View Cambios hibernate.cfg.xml
Dialect, user and password
This:
<session-factory>
<!-- Tomcat + Hypersonic -->
<property name="hibernate.connection.datasource">java:comp/env/jdbc/OpenXavaTestDS</property>
<property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
@jrichardsz
jrichardsz / Datasource Tomcat en el archivo context.xml
Created Oct 13, 2013
Datasource Tomcat en el archivo context.xml
View Datasource Tomcat en el archivo context.xml
<Resource
name="jdbc/EmpresaDS"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/empresa"
username="myuser" password="mypass"
validationQuery="select 1"
maxActive="100"
@jrichardsz
jrichardsz / build.xml
Last active Dec 25, 2015
Configuracion de driver de coneccion a mysql.
View build.xml
<target name="actualizarEsquema">
<ant antfile="../OpenXava/build.xml" target="updateSchemaJPA">
<property name="persistence.unit" value="junit"/>
<property name="schema.path" value="x:\RICHARD\drivers\mysql-connector-java-5.1.18.jar"/>
</ant>
</target>