This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script> | |
function calculaRFC() { | |
function quitaArticulos(palabra) { | |
return palabra.replace("DEL ", "").replace("LAS ", "").replace("DE ", | |
"").replace("LA ", "").replace("Y ", "").replace("A ", ""); | |
} | |
function esVocal(letra) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.hibernate</groupId> | |
<artifactId>hibernate-core</artifactId> | |
<version>3.5.1-Final</version> | |
</dependency> | |
<dependency> | |
<groupId>org.hibernate.javax.persistence</groupId> | |
<artifactId>hibernate-jpa-2.0-api</artifactId> | |
<version>1.0.1.Final</version> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE hibernate-configuration PUBLIC | |
"-//Hibernate/Hibernate Configuration DTD 3.0//EN" | |
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> | |
<hibernate-configuration> | |
<session-factory> | |
<property name="hibernate.connection.driver_class">org.h2.Driver</property> | |
<property name="hibernate.connection.password">sa</property> | |
<property name="hibernate.connection.url">jdbc:h2:tcp://localhost/mem:test</property> | |
<property name="hibernate.connection.username">sa</property> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Banco implements java.io.Serializable { | |
private Integer idbanco; | |
private String nombre; | |
public Banco() { | |
} | |
public Banco(Integer idbanco, String nombre) { | |
this.idbanco = idbanco; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" | |
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> | |
<!-- Generated 1/12/2012 04:06:04 AM by Hibernate Tools 3.4.0.CR1 --> | |
<hibernate-mapping> | |
<class name="javagurus.curso.frameworks.model.Banco" table="BANCO" schema="PUBLIC" catalog="TEST"> | |
<id name="idbanco" type="integer"> | |
<column name="IDBANCO"/> | |
<generator class="increment" /> | |
</id> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HibernateUtil { | |
private static final SessionFactory sessionFactory; | |
/** | |
* Inicializa la fabrica de sesiones de hibernate | |
*/ | |
static { | |
sessionFactory = new Configuration(). | |
configure(). | |
buildSessionFactory(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BancoDAO { | |
public int insertar(Banco banco) { | |
Session session = HibernateUtil.getSessionFactory().openSession(); | |
// Inicia una transaccion | |
Transaction transaccion = session.beginTransaction(); | |
int idBanco = -1; | |
try { | |
idBanco = (Integer) session.save(banco); // INSERT INTO BANCO ..... | |
transaccion.commit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BancoDaoTest { | |
private BancoDAO bancoDAO = new BancoDAO(); | |
@Test | |
public void testInsertar() { | |
Banco banco = new Banco(); | |
banco.setNombre("Banco 11082012"); | |
int idBanco = bancoDAO.insertar(banco); | |
assertTrue(idBanco != -1); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> | |
<Configure id="Server" class="org.eclipse.jetty.server.Server"> | |
<New id="DSTest" class="org.eclipse.jetty.plus.jndi.Resource"> | |
<Arg></Arg> | |
<Arg>java:url/datasource</Arg> | |
<Arg> | |
<New class="oracle.jdbc.pool.OracleDataSource"> | |
<Set name="DriverType">thin</Set> | |
<Set name="URL">jdbc:oracle:thin:@host:1521:name</Set> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://localhost:8080/nombreproyecto/config-browser/actionNames.rock |
OlderNewer