hibernatehql

I have some questions about HQL syntax


guys. I'm a novice learning Hibernate.Recently,I learned some konwledge about Hibernate query language. When learned FROM systnx,I want to konw 'SELECT A FROM A' is same with 'FROM A'?

I ask for GTP,it can't give me a correct answer....


Solution

  • From the rather antiquated Hibernate query language documentation we can see that either version is acceptable:

    FROM A
    SELECT A FROM A
    

    You would use the SELECT version more typically if you wanted to choose certain fields from the entity, e.g.

    SELECT field1, field2 FROM EntityA