🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.java
Article #141868

Re: Jak skorzystać z widoków bazy danych w JSF z użyciamiem EntityManager?

#141868
From: Wito
Date: Thu, 23 Oct 2008 09:05
48 lines
3020 bytes
On 22 Paź, 13:21, Brzezi <usunto.brz...@enter.net.pl> wrote:
> śro, 22 paź 2008 o 14:47 GMT, Wito napisał(a):
>
> > a jak powinna wyglądać encja takiego widoku?
> > bo mi ciągle wywala, że nie ma takiego schematu
>
> Normalnie :) zamiast nazwy tabeli podajesz nazwe widoku
>
> dla przykladu:
>
> jezeli jest tabela TABELA, na ktorej masz oparta encje, to mozna z niej
> zrobic najprostrzy widok:
>
> create view TABELAVIEW as select * from TABELA;
>
> i potem w mapowaniu encji podmieniasz tylko TABELA na TABELAVIEW i powinno
> dzialac
>
> Pozdrawiam
>         Brzezi
> --
> [    E-mail: brz...@enter.net.pl ][   brzezi:~# uptime                        ]
> [       Ekg: #3781111            ][    14:49:59 up 8 days, 16:37,  3 users,   ]
> [ LinuxUser: #249916             ][    load average: 0.17, 0.09, 0.04         ]

no nadal nie działa

mam zrobiony widok v_czytania i encje Vczytania.java

@Entity
@Table(name = "V_CZYTANIA")
@NamedQueries({@NamedQuery(name = "VCzytania.poID", query = "SELECT t
FROM v_czytania t")})


a później w komponencie zarządzanym

private List<VCzytania> viewList = new ArrayList<VCzytania>();
...

public List<VCzytania> getViewData(){
        em.clear();
        viewList.clear();
 
viewList.addAll(em.createNamedQuery("VCzytania.poID").getResultList());

        return viewList;
}
Technical Details
Message-ID: <02fa4642-bf55-4032-bd80-be7cff3060da@l77g2000hse.googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!nf1.ipartners.pl!ipartners.pl!news.nask.pl!news.nask.org.pl!newsfeed00.sul.t-online.de!t-online.de!border2.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!l77g2000hse.googlegroups.com!not-for-mail
References: <9d5ee091-68c9-4c11-84a0-85a4e677159c@m36g2000hse.googlegroups.com> <slrn.pl.gfu1i9.gsc.usunto.brzezi@localhost.localdomain> <3f784cce-41d8-4924-a772-63f3247e78a0@8g2000hse.googlegroups.com> <slrn.pl.gfu8h4.gsc.usunto.brzezi@localhost.localdomain>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!nf1.ipartners.pl!ipartners.pl!news.nask.pl!news.nask.org.pl!newsfeed00.sul.t-online.de!t-online.de!border2.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!l77g2000hse.googlegroups.com!not-for-mail
From: Wito <wolewniczak@gmail.com>
Newsgroups: pl.comp.lang.java
Subject: Re: Jak skorzystać z widoków bazy
 danych w JSF z użyciamiem EntityManager?
Date: Thu, 23 Oct 2008 02:05:44 -0700 (PDT)
Organization: http://groups.google.com
Lines: 53
Message-ID: <02fa4642-bf55-4032-bd80-be7cff3060da@l77g2000hse.googlegroups.com>
References: <9d5ee091-68c9-4c11-84a0-85a4e677159c@m36g2000hse.googlegroups.com>  <slrn.pl.gfu1i9.gsc.usunto.brzezi@localhost.localdomain> <3f784cce-41d8-4924-a772-63f3247e78a0@8g2000hse.googlegroups.com>  <slrn.pl.gfu8h4.gsc.usunto.brzezi@localhost.localdomain>
NNTP-Posting-Host: 217.97.198.98
Mime-Version: 1.0
X-Trace: posting.google.com 1224752744 26180 127.0.0.1 (23 Oct 2008 09:05:44 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 23 Oct 2008 09:05:44 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: l77g2000hse.googlegroups.com; posting-host=217.97.198.98;  posting-account=V5sjawkAAAAQlMmPYs5SKVG1iccFBIqI
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.0.3)  Gecko/2008092417 Firefox/3.0.3,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 Serwer_proxy_POSD_ODG_w_Olsztynie:8080 (squid/2.6.STABLE18)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit