File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate HQL returns partial data? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "Hibernate HQL returns partial data?" Watch "Hibernate HQL returns partial data?" New topic
Author

Hibernate HQL returns partial data?

sreenivas jeenor
Ranch Hand

Joined: Jan 09, 2005
Posts: 125
Hi All,

I am trying to print the values of Members Tables.
I am able to print only Name value where as Password value is shown null.

---------------------------------
here is the code
------------------------------

List mems =session.createQuery("from Members m order by m.name asc").list();
Iterator iter = mems.iterator();
while (iter.hasNext())
{
Members members = (Members)iter.next();
System.out.println("members name is..."+members.getName());
System.out.println("members pswd is..."+members.getPassword());
}

------------------------------
members.hbm.xml
---------------------
<hibernate-mapping>

<class name="org.Members" table="MEMBERS">
<id name="id" column="ID">
<generator class="increment"/>
</id>

<property
name="name"
column="Name"/>

<property
name="password"
column="Password"/>

</class>

</hibernate-mapping>

------------------------
how can print the password value without using Object[] array.

Thanks
Sreenivas
[ September 11, 2007: Message edited by: sreenivas jeenor ]
sreenivas jeenor
Ranch Hand

Joined: Jan 09, 2005
Posts: 125
found the problem.Now its working.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17233
    
    1

So what was your issue? It might help someone out later when they search and see your thread.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Hibernate HQL returns partial data?
 
Similar Threads
hibernate mapping
Hibernate : many to many mapping and inner join query results.
Hibernate inserting man-to-one fails
Problem in mapping
problem with hibernate integration