Skip to content

Instantly share code, notes, and snippets.

View jrichardsz's full-sized avatar

JRichardsz jrichardsz

View GitHub Profile
/*******************************************************************************
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2012 by Pentaho : http://www.pentaho.com
*
*******************************************************************************
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with
@jrichardsz
jrichardsz / flexible_system.java
Created October 15, 2015 17:57
System that supports dynamic behavior.
Desarrollar la clase Producto para que soporte procesos o reglas dinamicas:
class Producto {
method1()
method2()
method3()
submit() {
@jrichardsz
jrichardsz / inflexible_system.java
Last active October 15, 2015 17:59
Inflexible System Example
class Producto {
method1()
method2()
method3()
submit() {
genericSubmit()
}
}
@jrichardsz
jrichardsz / public class Cliente
Created October 13, 2013 05:10
Simple pojo "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 / hibernate.cfg.xml
Last active December 25, 2015 10:09
Configuracion del archivo 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 / Log de exito al generar el war openxava
Created October 13, 2013 08:18
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 October 13, 2013 08:38
Configuracion del archivo 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 / context.xml
Last active December 25, 2015 10:09
Datasource Tomcat usado por la aplicacion para conectarse a la base de datos.
<?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 / Datasource Tomcat en el archivo context.xml
Created October 13, 2013 15:10
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 December 25, 2015 10:49
Configuracion de driver de coneccion a mysql.
<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>