[JBoss Seam] - Re: Collection Loading
by fredzep
Sorry,
| <class
| name="entidades.bdufop.Sistema"
| table="sistema"
| schema="public"
| >
|
| <id
| name="codigo"
| column="codigo"
| type="java.lang.String"
| >
| <generator class="assigned">
| </generator>
|
| </id>
|
| <property
| name="descricao"
| type="java.lang.String"
| update="true"
| insert="true"
| column="descricao"
| not-null="true"
| />
|
| <property
| name="disponivel"
| type="java.lang.String"
| update="true"
| insert="true"
| column="disponivel"
| not-null="true"
| />
|
| <property
| name="mensagem"
| type="java.lang.String"
| update="true"
| insert="true"
| column="mensagem"
| />
|
|
| <set name="aplicacoes" lazy="true" cascade="all">
| <key column="cod_sistema"/>
| <one-to-many class="entidades.bdufop.Aplicacao"/>
| </set>
|
| </class>
|
|
| <class
| name="entidades.bdufop.Aplicacao"
| table="aplicacao"
| schema="public"
| >
|
| <composite-id
| name="id"
| class="entidades.bdufop.Aplicacao_pk"
| >
|
| <key-property
| name="codigo_sistema"
| type="java.lang.String"
| column="cod_sistema"
| />
|
| <key-property
| name="codigo_aplicacao"
| type="java.lang.String"
| column="codigo"
| />
|
| </composite-id>
|
| <many-to-one name="sistema"
| class="entidades.bdufop.Sistema"
| column="cod_sistema"
| insert="false"
| update="false"
| unique="true"
| not-null="true"/>
|
| <property
| name="descricao"
| type="java.lang.String"
| column="descricao"
| not-null="true"
| />
|
| <property
| name="versao"
| type="java.lang.String"
| column="versao"
| />
|
| <property
| name="dt_versao"
| type="java.util.Date"
| column="dt_versao"
| />
|
|
| <property
| name="disponivel"
| type="java.lang.String"
| column="disponivel"
| not-null="true"
| />
|
| <property
| name="url"
| type="java.lang.String"
| column="url"
| />
|
| <property
| name="mensagem"
| type="java.lang.String"
| column="mensagem"
| />
|
| </class>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048714#4048714
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048714
18 years, 11 months
[EJB/JBoss] - How to deploy on JBoss a CMP bean that uses a composite PK i
by hjoly
Hi,
I'm trying to port a sun tutorial into JBoss 4.0.4. Some of the CMP beans have a PK class whose fields refer to a composite PK in the corresponding table.
What I don't know is how to specify this in the jbosscmp-jdbc.xml file. In fact I'm asking if it's even possible to have composite primary keys for CMP beans in JBoss.
If so, how to do it. Here's my bean, its PK class & its table:
create table PART (
| PART_NUMBER VARCHAR(15) NOT NULL,
| REVISION NUMERIC(2) NOT NULL,
| DESCRIPTION VARCHAR(255) NULL,
| PRIMARY KEY (PART_NUMBER, REVISION),
| );
|
| public final class PartKey implements java.io.Serializable {
| public String partNumber;
| public int revision;
| public boolean equals(Object otherOb) {...}
| public int hashCode() {...}
| public String toString() {...}
| }
|
| /**
| * @ejb.bean
| * name=PartBean
| * local-jndi-name="ejb/LocalPart"
| * type="CMP"
| * reentrant="false"
| * cmp-version="2.x"
| * schema="Part"
| * view-type="local"
| *
| * @ejb.persistence table-name="PART"
| *
| * @ejb.pk class="dataregistry.PartKey"
| *
| * @jboss.persistence
| * datasource="java:/SunTutOrderDS"
| * datasource-mapping="Hypersonic SQL"
| * table-name="PART"
| * create-table="false"
| * remove-table="false"
| * alter-table="false"
| *
| * @ejb.finder
| * signature="dataregistry.LocalPart findByPrimaryKey(java.lang.String, java.lang.Integer)"
| * query="SELECT OBJECT(o) FROM Part o WHERE o.partNumber = ?1 AND o.revision = ?2"
| * view-type="local"
| */
| public abstract class PartBean implements EntityBean {
|
| /**
| * @ejb.persistence column-name="PART_NUMBER" jdbc-type="VARCHAR" sql-type="VARCHAR"
| */
| public abstract String getPartNumber();
|
| /**
| * @ejb.persistence column-name="REVISION" jdbc-type="NUMERIC" sql-type="NUMERIC"
| */
| public abstract int getRevision();
|
| /**
| * @ejb.persistence column-name="DESCRIPTION" jdbc-type="VARCHAR" sql-type="VARCHAR"
| */
| public abstract String getDescription();
|
| ...
| }
|
I thought that a @jboss.unknown-pk would do it but it's not possible to associate more than one column-name to it.
Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048712#4048712
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048712
18 years, 11 months
[JBoss Seam] - Collection Loading
by fredzep
Hi,
I have a collection that it is not loaded, in log it seems to be ok, but when i access the collection there is no element.
<property
name="descricao"
type="java.lang.String"
update="true"
insert="true"
column="descricao"
not-null="true"
/>
<property
name="disponivel"
type="java.lang.String"
update="true"
insert="true"
column="disponivel"
not-null="true"
/>
<one-to-many class="entidades.bdufop.Aplicacao"/>
<composite-id
name="id"
class="entidades.bdufop.Aplicacao_pk"
>
<key-property
name="codigo_sistema"
type="java.lang.String"
column="cod_sistema"
/>
<key-property
name="codigo_aplicacao"
type="java.lang.String"
column="codigo"
/>
</composite-id>
<many-to-one name="sistema"
class="entidades.bdufop.Sistema"
column="cod_sistema"
insert="false"
update="false"
unique="true"
not-null="true"/>
<property
name="descricao"
type="java.lang.String"
column="descricao"
not-null="true"
/>
<property
name="disponivel"
type="java.lang.String"
column="disponivel"
not-null="true"
/>
Log
12:21:42,060 DEBUG DefaultInitializeCollectionEventListener:41 - initializing collection [entidades.bdufop.Sistema.aplicacoes#ACESSO]
12:21:42,063 DEBUG DefaultInitializeCollectionEventListener:47 - checking second-level cache
12:21:42,067 DEBUG DefaultInitializeCollectionEventListener:59 - collection not cached
12:21:42,071 DEBUG Loader:1911 - loading collection: [entidades.bdufop.Sistema.aplicacoes#ACESSO]
12:21:42,075 DEBUG AbstractBatcher:311 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
12:21:42,079 DEBUG ConnectionManager:415 - opening JDBC connection
12:21:42,118 DEBUG SQL:346 - select aplicacoes0_.cod_sistema as cod1_1_, aplicacoes0_.codigo as codigo1_, aplicacoes0_.cod_sistema as cod1_1_0_, aplicacoes0_.codigo as codigo1_0_, aplicacoes0_.descricao as descricao1_0_, aplicacoes0_.versao as versao1_0_, aplicacoes0_.dt_versao as dt5_1_0_, aplicacoes0_.disponivel as disponivel1_0_, aplicacoes0_.url as url1_0_, aplicacoes0_.mensagem as mensagem1_0_ from public.aplicacao aplicacoes0_ where aplicacoes0_.cod_sistema=?
Hibernate: select aplicacoes0_.cod_sistema as cod1_1_, aplicacoes0_.codigo as codigo1_, aplicacoes0_.cod_sistema as cod1_1_0_, aplicacoes0_.codigo as codigo1_0_, aplicacoes0_.descricao as descricao1_0_, aplicacoes0_.versao as versao1_0_, aplicacoes0_.dt_versao as dt5_1_0_, aplicacoes0_.disponivel as disponivel1_0_, aplicacoes0_.url as url1_0_, aplicacoes0_.mensagem as mensagem1_0_ from public.aplicacao aplicacoes0_ where aplicacoes0_.cod_sistema=?
12:21:42,122 DEBUG AbstractBatcher:424 - preparing statement
12:21:42,129 DEBUG StringType:80 - binding 'ACESSO' to parameter: 1
12:21:42,144 DEBUG AbstractBatcher:327 - about to open ResultSet (open ResultSets: 0, globally: 0)
12:21:42,148 DEBUG Loader:1040 - result set contains (possibly empty) collection: [entidades.bdufop.Sistema.aplicacoes#ACESSO]
12:21:42,152 DEBUG CollectionLoadContext:84 - uninitialized collection: initializing
12:21:42,509 DEBUG Loader:682 - processing result set
12:21:42,513 DEBUG Loader:687 - result set row: 0
12:21:42,517 DEBUG StringType:122 - returning 'ACESSO ' as column: cod1_1_0_
12:21:42,542 DEBUG StringType:122 - returning 'AP.ACESSO ' as column: codigo1_0_
12:21:42,550 DEBUG Loader:1164 - result row: EntityKey[entidades.bdufop.Aplicacao#component[codigo_sistema,codigo_aplicacao]{codigo_aplicacao=AP.ACESSO , codigo_sistema=ACESSO }]
12:21:42,558 DEBUG Loader:1347 - Initializing object from ResultSet: [entidades.bdufop.Aplicacao#component[codigo_sistema,codigo_aplicacao]{codigo_aplicacao=AP.ACESSO , codigo_sistema=ACESSO }]
12:21:42,563 DEBUG AbstractEntityPersister:1860 - Hydrating entity: [entidades.bdufop.Aplicacao#component[codigo_sistema,codigo_aplicacao]{codigo_aplicacao=AP.ACESSO , codigo_sistema=ACESSO }]
12:21:42,574 DEBUG StringType:122 - returning 'ACESSO ' as column: cod1_1_0_
12:21:42,579 DEBUG StringType:122 - returning 'DESCRICAO APLICACAO ACESSO ' as column: descricao1_0_
12:21:42,586 DEBUG StringType:122 - returning ' ' as column: versao1_0_
12:21:42,592 DEBUG TimestampType:122 - returning '2008-01-01 00:00:00' as column: dt5_1_0_
12:21:42,598 DEBUG StringType:122 - returning 'S' as column: disponivel1_0_
12:21:42,602 DEBUG StringType:122 - returning '' as column: url1_0_
12:21:42,608 DEBUG StringType:122 - returning '' as column: mensagem1_0_
12:21:42,613 DEBUG StringType:122 - returning 'ACESSO ' as column: cod1_1_
12:21:42,618 DEBUG Loader:972 - found row of collection: [entidades.bdufop.Sistema.aplicacoes#ACESSO ]
12:21:42,640 DEBUG CollectionLoadContext:100 - new collection: instantiating
12:21:42,659 DEBUG StringType:122 - returning 'ACESSO ' as column: cod1_1_
12:21:42,665 DEBUG StringType:122 - returning 'AP.ACESSO ' as column: codigo1_
12:21:42,671 DEBUG DefaultLoadEventListener:153 - loading entity: [entidades.bdufop.Aplicacao#component[codigo_sistema,codigo_aplicacao]{codigo_aplicacao=AP.ACESSO , codigo_sistema=ACESSO }]
12:21:42,677 DEBUG DefaultLoadEventListener:304 - attempting to resolve: [entidades.bdufop.Aplicacao#component[codigo_sistema,codigo_aplicacao]{codigo_aplicacao=AP.ACESSO , codigo_sistema=ACESSO }]
12:21:42,687 DEBUG DefaultLoadEventListener:313 - resolved object in session cache: [entidades.bdufop.Aplicacao#component[codigo_sistema,codigo_aplicacao]{codigo_aplicacao=AP.ACESSO , codigo_sistema=ACESSO }]
12:21:42,712 DEBUG Loader:709 - done processing result set (1 rows)
12:21:42,716 DEBUG AbstractBatcher:334 - about to close ResultSet (open ResultSets: 1, globally: 1)
12:21:42,721 DEBUG AbstractBatcher:319 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
12:21:42,757 DEBUG AbstractBatcher:470 - closing statement
12:21:42,806 DEBUG ConnectionManager:398 - aggressively releasing JDBC connection
12:21:42,815 DEBUG ConnectionManager:435 - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
12:21:42,821 DEBUG Loader:839 - total objects hydrated: 1
12:21:42,829 DEBUG TwoPhaseLoad:107 - resolving associations for [entidades.bdufop.Aplicacao#component[codigo_sistema,codigo_aplicacao]{codigo_aplicacao=AP.ACESSO , codigo_sistema=ACESSO }]
12:21:42,834 DEBUG DefaultLoadEventListener:153 - loading entity: [entidades.bdufop.Sistema#ACESSO ]
12:21:42,874 DEBUG DefaultLoadEventListener:230 - creating new proxy for entity
12:21:43,422 DEBUG TwoPhaseLoad:206 - done materializing entity [entidades.bdufop.Aplicacao#component[codigo_sistema,codigo_aplicacao]{codigo_aplicacao=AP.ACESSO , codigo_sistema=ACESSO }]
12:21:43,427 DEBUG CollectionLoadContext:262 - 2 collections were found in result set for role: entidades.bdufop.Sistema.aplicacoes
12:21:43,432 DEBUG CollectionLoadContext:206 - collection fully initialized: [entidades.bdufop.Sistema.aplicacoes#ACESSO]
12:21:43,436 DEBUG CollectionLoadContext:206 - collection fully initialized: [entidades.bdufop.Sistema.aplicacoes#ACESSO ]
12:21:43,441 DEBUG CollectionLoadContext:272 - 2 collections initialized for role: entidades.bdufop.Sistema.aplicacoes
12:21:43,445 DEBUG StatefulPersistenceContext:748 - initializing non-lazy collections
12:21:43,449 DEBUG Loader:1935 - done loading collection
12:21:43,453 DEBUG DefaultInitializeCollectionEventListener:61 - collection initialized
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048711#4048711
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048711
18 years, 11 months
[JBoss Seam] - s:selectDate slowing page rendering
by koatto
I have a page with several date fields and pickers.
The pages loads slowly and blocks a little on every picker. Removing all the s:selectDate everything comes out immediately.
Looking at the generated html i've noticed that for every picker stuff like this is repeated :
//<![CDATA[
| var CAL_DAYS_SHORT = 'do,lu,ma,me,gi,ve,sa';
| var CAL_DAYS_MEDIUM = 'dom,lun,mar,mer,gio,ven,sab';
| var CAL_DAYS_LONG = 'domenica,lunedì,martedì,mercoledì,giovedì,venerdì,sabato';
| var CAL_MONTHS_MEDIUM = 'gen,feb,mar,apr,mag,giu,lug,ago,set,ott,nov,dic';
| var CAL_MONTHS_LONG = 'gennaio,febbraio,marzo,aprile,maggio,giugno,luglio,agosto,settembre,ottobre,novembre,dicembre';
| var CAL_FIRST_DAY_OF_WEEK = 1;
| var CAL_DATE_FORMAT = 'MM/dd/yyyy';
| //
| //]]>
|
| </script><script type="text/javascript"
| src="/MK/seam/resource/web/date/calendar.js">//<![CDATA[
| //
| //]]>
This could of course cause slowness. Any way to avoid that repetition?
Any other possible issue, i'm using seam 1.2.1?
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048710#4048710
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048710
18 years, 11 months