# HG changeset patch # User František Kučera <franta-hg@frantovo.cz> # Date 1237065299 -3600 # Node ID 55b52df32ec2be8dc96f2f07020b7ee81de8766f # Parent 16a1fc2116d6c0fd72c6f76dbd60a8dee026bfce JPA: persistence.xml a první mapování diff -r 16a1fc2116d6 -r 55b52df32ec2 java/HibernateDemo1/HibernateDemo1-ejb/src/conf/Cil.hbm.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/HibernateDemo1/HibernateDemo1-ejb/src/conf/Cil.hbm.xml Sat Mar 14 22:14:59 2009 +0100 @@ -0,0 +1,11 @@ +<?xml version="1.0"?> +<!DOCTYPE hibernate-mapping PUBLIC + "-//Hibernate/Hibernate Mapping DTD 3.0//EN" + "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> +<hibernate-mapping> + <class name="cz.frantovo.hibernateDemo1.dto.Cil" table="cil"> + <id name="id" column="id"/> + <property name="nazev" column="nazev"/> + <property name="url" column="url"/> + </class> +</hibernate-mapping> \ No newline at end of file diff -r 16a1fc2116d6 -r 55b52df32ec2 java/HibernateDemo1/HibernateDemo1-ejb/src/conf/persistence.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/HibernateDemo1/HibernateDemo1-ejb/src/conf/persistence.xml Sat Mar 14 22:14:59 2009 +0100 @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<persistence version="1.0" 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"> + <persistence-unit name="POSZ-ejbPU" transaction-type="JTA"> + <provider>org.hibernate.ejb.HibernatePersistence</provider> + <jta-data-source>jdbc/hrisnicispameri</jta-data-source> + <exclude-unlisted-classes>false</exclude-unlisted-classes> + <properties> + <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" /> + <property name="hibernate.hbm2ddl.auto" value="create" /> + <property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider" /> + <property name="hibernate.cache.use_query_cache" value="true" /> + <property name="hibernate.max_fetch_depth " value="3" /> + <property name="hibernate.default_batch_fetch_size" value="16" /> + <property name="hibernate.order_updates" value="true" /> + <property name="hibernate.order_inserts" value="true" /> + <property name="hibernate.show_sql" value="false"/> + </properties> + </persistence-unit> +</persistence> \ No newline at end of file diff -r 16a1fc2116d6 -r 55b52df32ec2 java/HibernateDemo1/HibernateDemo1-ejb/src/java/cz/frantovo/hibernateDemo1/CilDAOBean.java --- a/java/HibernateDemo1/HibernateDemo1-ejb/src/java/cz/frantovo/hibernateDemo1/CilDAOBean.java Sat Mar 14 21:58:41 2009 +0100 +++ b/java/HibernateDemo1/HibernateDemo1-ejb/src/java/cz/frantovo/hibernateDemo1/CilDAOBean.java Sat Mar 14 22:14:59 2009 +0100 @@ -1,10 +1,7 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - package cz.frantovo.hibernateDemo1; +import cz.frantovo.hibernateDemo1.dto.Cil; +import java.util.Collection; import javax.ejb.Stateless; /** @@ -13,8 +10,10 @@ */ @Stateless public class CilDAOBean implements CilDAORemote { + + public Collection<Cil> getCile() { + throw new UnsupportedOperationException("Not supported yet."); + } - // Add business logic below. (Right-click in editor and choose - // "Insert Code > Add Business Method" or "Web Service > Add Operation") } diff -r 16a1fc2116d6 -r 55b52df32ec2 java/HibernateDemo1/HibernateDemo1-lib/src/cz/frantovo/hibernateDemo1/CilDAORemote.java --- a/java/HibernateDemo1/HibernateDemo1-lib/src/cz/frantovo/hibernateDemo1/CilDAORemote.java Sat Mar 14 21:58:41 2009 +0100 +++ b/java/HibernateDemo1/HibernateDemo1-lib/src/cz/frantovo/hibernateDemo1/CilDAORemote.java Sat Mar 14 22:14:59 2009 +0100 @@ -1,10 +1,7 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - package cz.frantovo.hibernateDemo1; +import cz.frantovo.hibernateDemo1.dto.Cil; +import java.util.Collection; import javax.ejb.Remote; /** @@ -13,5 +10,6 @@ */ @Remote public interface CilDAORemote { - + + public Collection<Cil> getCile(); }