bamini mini

Greenhorn
+ Follow
since May 05, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by bamini mini

hi
i cant get multiple column values by using the foll. query.

supplierList=sess.find("select a.id,a.desc,from groupAccount a in(b.msupplier,b.mnumber from supProduct b where a.id=b.supcode)");


when i am using this query in sql directly, i got the answer.
but in session, i cant get the result.

i think i should use the join query or subclass query.

if anybody knows ,give that concept.
when i am using in query method.

i got the following error.

unexpected token in query (i got this error in server)
and iexplore i got the following error


org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)


root cause

java.lang.NullPointerException
org.apache.jsp.findProducts_jsp._jspService(findProducts_jsp.java:70)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
hi



when you give the name of your column in hbm file, it must be different from the column name.

you dont give the same name for property name and column name.

for eg.

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

both column nameand property name mustnot be same.

ok
and when you are writting the jave file for getting property

u call the getterfile and setterfile like this.
public string getName()
{
return name;}
public void setName(String value)
{
this.name=value;
}

ok change the property name in hbm file.you should give different name from the column name

bye
hi

i want to get records from two tables by using join query.
but i got the queryexception error.
i can't get the multiple column values from two tables.
how i will write the select query for getting records from two tables.
pl. help me(if possible)

i give the java files below.


public List getSupforProducts(String prdcode)
{
try
{
SessionFactory sf=HibernateEnvironment.getSessionFactory();
Session sess=sf.openSession();
List supplierList=sess.find("select a.id,a.descfrom groupAccountin(,b.msupplier,b.mnumber from supProduct b where a.id=b.supcode");
Transaction tx = sess.beginTransaction();
tx.commit();
sess.close();
}catch(Exception CreateException){
CreateException.printStackTrace();
}
supplierList;
}