-->
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.  [ 2 posts ] 
Author Message
 Post subject: Difficulty in Listing for the code of the session that is ve
PostPosted: Mon Jul 27, 2009 5:10 pm 
Newbie

Joined: Mon Jul 27, 2009 5:07 pm
Posts: 2
System.out.println ("HELLO PERSONAL");
I am beginning the studies with Hibernate and I am wondering how I do for logar with a supplier that consists a codEmpresa in his/her table as key FK, to the logar and to verify that the code is an altomaticamente he falls in the listing of suppliers, I am with doubt as I recover that and as I do in HBM:

<CODE>

<? xml version = "1.0" encoding = "UTF-8"?>
<! DOCTYPE hibernate-mapping PUBLIC
"- / / Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class name = "br.com.sisger.model.bean.Fornecedor" table = "supplier">
<id name = "code">
<generator class = "native"></generator>
</ id>
<property name = "nome"></property>
<property name = "endereco"></property>
<property name = "email"></property>
<property name = "bairro"></property>
<property name = "cidade"></property>
<property name = "cep"></property>
<property name = "estado"></property>
<property name = "fone"></property>
<property name = "celular"></property>
<property name = "cpf"></property>
<property name = "obs"></property>
<property name = "rg"></property>
<property name = "orgaorg"></property>
<property name = "desde"></property>
<property name = "cnpj"></property>
<property name = "insest"></property>
<property name = "fax"></property>
<property name = "contato"></property>
<property name = "auditoria"></property>
<property name = "codEmpresa"></property>


<bag name = "products" table = "product" inverse = "true" lazy = "false" fetch = "select" cascade = "all">
<key column = "fornecedor_codigo"></key>
<one-to-many class = "br.com.sisger.model.bean.Produto" />
</ bag>
</ class>
</ hibernate-mapping>



</ CODE>


See that when listing my suppliers I list my products that each one has, but he/she needed to catch him/it of the section and to list him/it:
<property name = "codEmpresa"></property>

Only with the code 1 that is it of his/her login, in other words, only to list suppliers with codEmpresa = 1. Hug.

excuse me for my English to be very scratched lolololo


Top
 Profile  
 
 Post subject: Re: Difficulty in Listing for the code of the session that is ve
PostPosted: Wed Jul 29, 2009 8:52 am 
Newbie

Joined: Mon Jul 27, 2009 5:07 pm
Posts: 2
Please!!!


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

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.