-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How to read mapping info in runtime
PostPosted: Wed Mar 26, 2008 6:13 am 
Newbie

Joined: Wed Mar 26, 2008 5:59 am
Posts: 2
Hi!

I'm having a problem reading a mapping info during runtime. I have been using metadata but I am having problems reading composite-id info.

The mapping file is:

<hibernate-mapping>
<class name="pt.company.comuns.adp.vo.ObterBloqueio" schema="ADM">
<composite-id name="id" class="pt.company.comuns.adp.vo.ObterBloqueioId">
<key-property name="cfrConReg" type="java.lang.String" column="CFR_COD_REG" length="15" />
<key-property name="cfrCodTip" type="java.lang.String" column="CFR_COD_TIP" length="3" />
<key-property name="cfrCodOpr" type="java.lang.String" column="CFR_COD_OPR" length="7" />
<key-property name="cfrCodConta" type="java.lang.String" column="CFR_COD_CONTA" length="8" />
<key-property name="cfrCodReg1" type="java.lang.String" column="CFR_COD_REG_1"/>
<key-property name="cfrCodOpr1" type="java.lang.String" column="CFR_COD_OPR_1"/>
</composite-id>
<property name="cfrConBanCli" type="java.lang.Long">
<column name="CFR_CON_BAN_CLI" length="9" not-null="true" />
</property>
<property name="cfrConBanNat" type="java.lang.Long">
<column name="CFR_CON_BAN_NAT" length="2" not-null="true" />
</property>
<property name="cfrConBanSeq" type="java.lang.Long">
<column name="CFR_CON_BAN_SEQ" length="3" not-null="true" />
</property>
<property name="cfrCodEst" type="java.lang.String">
<column name="CFR_COD_EST" not-null="true" />
</property>
<property name="dataCriacao" type="java.util.Date">
<column name="DATA_CRIACAO" not-null="true" />
</property>
<property name="cfrTexto" type="java.lang.String">
<column name="CFR_TEXTO" not-null="true" />
</property>
<property name="cfrCodMov" type="java.lang.String">
<column name="CFR_USR_MOV" not-null="true" />
</property>
<property name="cfrDatMov" type="java.util.Date">
<column name="CFR_DAT_MOV" not-null="true" />
</property>
<property name="cfrChnMov" type="java.lang.String">
<column name="CFR_CHN_MOV" not-null="true" />
</property>
<property name="cfrCodTit" type="java.lang.String">
<column name="CFR_CODTIT" length="9" not-null="false"/>
</property>
<property name="cfrCofre" type="java.lang.String">
<column name="CFR_COFRE" length="2" not-null="false"/>
</property>
<property name="cfrQt" type="java.lang.Long">
<column name="CFR_QT" not-null="false"/>
</property>
<property name="cfrGrau" type="java.lang.Long">
<column name="CFR_GRAU" length="2" not-null="false"/>
</property>

</class>

<sql-query name="ObterBloqueio" callable="true">
<return class="pt.company.comuns.adp.vo.ObterBloqueio">
<return-property name="id">
<return-column name="CFR_COD_REG"/>
<return-column name="CFR_COD_TIP"/>
<return-column name="CFR_COD_OPR"/>
<return-column name="CFR_COD_CONTA"/>
<return-column name="CFR_COD_REG_1"/>
<return-column name="CFR_COD_OPR_1"/>
</return-property>
<return-property name="cfrConBanCli" column="CFR_CON_BAN_CLI"/>
<return-property name="cfrConBanNat" column="CFR_CON_BAN_NAT"/>
<return-property name="cfrConBanSeq" column="CFR_CON_BAN_SEQ"/>
<return-property name="cfrCodEst" column="CFR_COD_EST"/>
<return-property name="dataCriacao" column="DATA_CRIACAO"/>
<return-property name="cfrTexto" column="CFR_TEXTO"/>
<return-property name="cfrCodMov" column="CFR_USR_MOV"/>
<return-property name="cfrDatMov" column="CFR_DAT_MOV"/>
<return-property name="cfrChnMov" column="CFR_CHN_MOV"/>
<return-property name="cfrCodTit" column="CFR_CODTIT"/>
<return-property name="cfrCofre" column="CFR_COFRE"/>
<return-property name="cfrQt" column="CFR_QT"/>
<return-property name="cfrGrau" column="CFR_GRAU"/>
</return>
{ call WSP_GET_MOVBLOQ_HOST(?, :CFR_CON_BAN_CLI, :CFR_CON_BAN_NAT, :CFR_CON_BAN_SEQ, :CFR_COD_EST) }
</sql-query>
</hibernate-mapping>

I have to read durring runtime:
- Database Columns
- Property names
- Value of an instance

It works very well using metadata for the ObterBloqueio class but I am unable to retrieve complete information for the composite id (ObterBloqueioId).

Help please!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.