i tried the example for Hibernate what is given in Netbeans site..i had done step-by-step what they had said in that site...but im getting error while running HQL Query...here is the error im getting if i had given 'from Film'..the error im getting is
can anyone help me out why im getting that error..im new to Hibernate.
in HQL Query window....is it restricted to give only one query or more than that...because...i m facing problem if i enter more than one query..if im giving one query..it is working fine..but under that query i had given another query..it is showing error.In HQL Query i had given like this
from User as user where user.name like 'k%'
from User if i given like this im getting error as
i had searched and found the insert command in one of the sites...i applied in my application...but it is showing errors..i used as insert into Test1 (tid, tname) select oo.tid, oo.tname from Test1 oo and im getting error in 'Result' as
and in SQL im getting as 'null' can anyone suggest me how to do..here is my java file where i wrote insert commandtest.java code
I think you have taken the query example from this page.
The given query works fine for me.
You have to notice that the HQL query needs to have the class names (not the database table names and fields).
And also you need to map the entity classes (Test1, BackupStock) to the database tables using proper hibernate mapping files.
Also, the transaction start and end is required for the insert to become effective in the database.
Jagadeeswara Yaramala wrote SessionFactory factory = cfg.buildSessionFactory()
can anyone explain what does cfg and BackupStock takes and where should it be declared..and i modified my code as suggested by 'Jagadeeswara Yaramala' eventhough im getting same error..here is my code..