# HG changeset patch # User František Kučera # Date 1237067711 -3600 # Node ID 7698168255252581b4a074443d40d727711cbb69 # Parent 715acc59d67d5c547479511d11c983d8083d8bee Překlady a základ JSP(X). diff -r 715acc59d67d -r 769816825525 java/HibernateDemo1/HibernateDemo1-ejb/src/conf/Cil.hbm.xml --- a/java/HibernateDemo1/HibernateDemo1-ejb/src/conf/Cil.hbm.xml Sat Mar 14 22:22:46 2009 +0100 +++ b/java/HibernateDemo1/HibernateDemo1-ejb/src/conf/Cil.hbm.xml Sat Mar 14 22:55:11 2009 +0100 @@ -4,7 +4,7 @@ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> - + diff -r 715acc59d67d -r 769816825525 java/HibernateDemo1/HibernateDemo1-ejb/src/conf/persistence.xml --- a/java/HibernateDemo1/HibernateDemo1-ejb/src/conf/persistence.xml Sat Mar 14 22:22:46 2009 +0100 +++ b/java/HibernateDemo1/HibernateDemo1-ejb/src/conf/persistence.xml Sat Mar 14 22:55:11 2009 +0100 @@ -2,18 +2,16 @@ org.hibernate.ejb.HibernatePersistence - jdbc/hrisnicispameri + jdbc/HrisniciSpameri false - - - + - + \ No newline at end of file diff -r 715acc59d67d -r 769816825525 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 22:22:46 2009 +0100 +++ b/java/HibernateDemo1/HibernateDemo1-ejb/src/java/cz/frantovo/hibernateDemo1/CilDAOBean.java Sat Mar 14 22:55:11 2009 +0100 @@ -5,6 +5,7 @@ import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; +import javax.persistence.Query; /** * @@ -12,13 +13,17 @@ */ @Stateless public class CilDAOBean implements CilDAORemote { - - public static final String PU = "HibernateDemo1-PU"; + private static final String PU = "HibernateDemo1-PU"; @PersistenceContext(unitName = PU) private EntityManager em; public Collection getCile() { - throw new UnsupportedOperationException("Not supported yet."); + Query dotaz = em.createQuery("from " + t(Cil.class) + " o order by nazev"); + return dotaz.getResultList(); + } + + private static String t(Class trida) { + return trida.getSimpleName(); } } diff -r 715acc59d67d -r 769816825525 java/HibernateDemo1/HibernateDemo1-war/src/java/cz/frantovo/hibernateDemo/preklady.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/HibernateDemo1/HibernateDemo1-war/src/java/cz/frantovo/hibernateDemo/preklady.properties Sat Mar 14 22:55:11 2009 +0100 @@ -0,0 +1,1 @@ +preklady_cs.properties \ No newline at end of file diff -r 715acc59d67d -r 769816825525 java/HibernateDemo1/HibernateDemo1-war/src/java/cz/frantovo/hibernateDemo/preklady_cs.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/HibernateDemo1/HibernateDemo1-war/src/java/cz/frantovo/hibernateDemo/preklady_cs.properties Sat Mar 14 22:55:11 2009 +0100 @@ -0,0 +1,2 @@ +nazev=HibernateDemo1 +jazyk=\u010De\u0161tina diff -r 715acc59d67d -r 769816825525 java/HibernateDemo1/HibernateDemo1-war/src/java/cz/frantovo/hibernateDemo/preklady_en.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/HibernateDemo1/HibernateDemo1-war/src/java/cz/frantovo/hibernateDemo/preklady_en.properties Sat Mar 14 22:55:11 2009 +0100 @@ -0,0 +1,2 @@ +nazev=HibernateDemo1 +jazyk=angli\u010Dtina diff -r 715acc59d67d -r 769816825525 java/HibernateDemo1/HibernateDemo1-war/web/WEB-INF/casti/seznamCilu.jspx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/HibernateDemo1/HibernateDemo1-war/web/WEB-INF/casti/seznamCilu.jspx Sat Mar 14 22:55:11 2009 +0100 @@ -0,0 +1,6 @@ + + + +

ahoj

+ +
diff -r 715acc59d67d -r 769816825525 java/HibernateDemo1/HibernateDemo1-war/web/index.jsp --- a/java/HibernateDemo1/HibernateDemo1-war/web/index.jsp Sat Mar 14 22:22:46 2009 +0100 +++ b/java/HibernateDemo1/HibernateDemo1-war/web/index.jsp Sat Mar 14 22:55:11 2009 +0100 @@ -1,19 +1,18 @@ -<%-- - Document : index - Created on : 14.3.2009, 21:22:28 - Author : fiki ---%> +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> + -<%@page contentType="text/html" pageEncoding="UTF-8"%> - + - + - - JSP Page + + + <fmt:message key="nazev"/> -

Hello World!

+

+