Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6739699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:31:10+00:00 2026-05-26T11:31:10+00:00

I have an SQL statement with the names of the class instead of the

  • 0

I have an SQL statement with the names of the class instead of the names of the tables.
Then I use a ResultTransformer to map the result in a bean, but Hibernate does not transform the query(with the classes) in a query capable for Oracle.
The code is like this:

 Session sx = hibernateTemplate.getSessionFactory().openSession();
   SQLQuery q = sx.createSQLQuery(queryUser);
   sottoInterventiPagatiList = (List<SottoInterventiPagatiBean>)q.setResultTransformer(Transformers.aliasToBean(SottoInterventiPagatiBean.class)).list();

the query is:

 select pagaSott.codiSequPagaSottInte as codiSequPagaSottInte,
         pagaSott.impoSostSottInte as impoSostSottInte,
         pagaSott.impoRichSottInte as impoRichSottInte,  
         pagaSott.impoAcceSottInte as impoAcceSottInte,
         pagaSott.impoAmmeSottInte as impoAmmeSottInte,
         pagaSott.codiSottTipo as codiSottTipo,        
         pagaInte.tabAgriPsrClTipoInt.codiTipo as codiTipo,
         ammiDomaAiut.descSottTipo as descSottTipo,
         ammiDomaAiut.impoSpesTotaAmme as impoSpesTotaAmme,
         ammiDomaAiut.impoTotaAmme as impoTotaAmme
from AmmissibilitaDomandaAiuto ammiDomaAiut,
        PagamentiDoma pagaDoma,
        PagaInte pagaInte, PagaSottInte pagaSott
where pagaDoma.codiDomaAiut = ammiDomaAiut.domandaByCodiDomaAiut.codiDoma
and pagaDoma.tabAgriPsrClMisure.codiMisu = ammiDomaAiut.misure.codiMisu
and pagaInte.tabAgriPsrPagamentiDoma.codiSequPagaDoma = pagaDoma.codiSequPagaDoma
and pagaInte.tabAgriPsrClTipoInt.codiTipo = ammiDomaAiut.tipiIntervento.codiTipo
and pagaSott.tabAgriPsrPagaInte.codiSequPagaInte = pagaInte.codiSequPagaInte
and pagaSott.codiSottTipo = ammiDomaAiut.sottoTipiIntervento.codiSottTipo
and ammiDomaAiut.domandaByCodiDomaAiut.codiDoma =  13
and ammiDomaAiut.misure.codiMisu =  6

the bean is:

public class SottoInterventiPagatiBean implements Serializable{
  private static final long serialVersionUID = -1831093835824406823L;
  private Integer codiSequPagaSottInte;
  private Integer codiTipo;
  private BigDecimal codiSottTipo;
  private String descSottTipo;
  private BigDecimal impoSostSottInte;
  private BigDecimal impoRichSottInte;
  private BigDecimal impoAcceSottInte;
  private BigDecimal impoAmmeSottInte;
  private BigDecimal impoSpesTotaAmme;
  private BigDecimal impoTotaAmme;

  public Integer getCodiSequPagaSottInte() {

        return codiSequPagaSottInte;
  }

  public void setCodiSequPagaSottInte(Integer codiSequPagaSottInte) {

        this.codiSequPagaSottInte = codiSequPagaSottInte;
  }

  public Integer getCodiTipo() {

        return codiTipo;
  }

  public void setCodiTipo(Integer codiTipo) {

        this.codiTipo = codiTipo;
  }

  public BigDecimal getCodiSottTipo() {

        return codiSottTipo;
  }

  public void setCodiSottTipo(BigDecimal codiSottTipo) {

        this.codiSottTipo = codiSottTipo;
  }

  public String getDescSottTipo() {

        return descSottTipo;
  }

  public void setDescSottTipo(String descSottTipo) {

        this.descSottTipo = descSottTipo;
  }

  public BigDecimal getImpoSostSottInte() {

        return impoSostSottInte;
  }

  public void setImpoSostSottInte(BigDecimal impoSostSottInte) {

        this.impoSostSottInte = impoSostSottInte;
  }

  public BigDecimal getImpoRichSottInte() {

        return impoRichSottInte;
  }

  public void setImpoRichSottInte(BigDecimal impoRichSottInte) {

        this.impoRichSottInte = impoRichSottInte;
  }

  public BigDecimal getImpoAcceSottInte() {

        return impoAcceSottInte;
  }

  public void setImpoAcceSottInte(BigDecimal impoAcceSottInte) {

        this.impoAcceSottInte = impoAcceSottInte;
  }

  public BigDecimal getImpoAmmeSottInte() {

        return impoAmmeSottInte;
  }

  public void setImpoAmmeSottInte(BigDecimal impoAmmeSottInte) {

        this.impoAmmeSottInte = impoAmmeSottInte;
  }

  public BigDecimal getImpoSpesTotaAmme() {

        return impoSpesTotaAmme;
  }

  public void setImpoSpesTotaAmme(BigDecimal impoSpesTotaAmme) {

        this.impoSpesTotaAmme = impoSpesTotaAmme;
  }

  public BigDecimal getImpoTotaAmme() {

        return impoTotaAmme;
  }

  public void setImpoTotaAmme(BigDecimal impoTotaAmme) {

        this.impoTotaAmme = impoTotaAmme;
  }  

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:31:11+00:00Added an answer on May 26, 2026 at 11:31 am

    Use session.createQuery(…) instead of createSQLQuery(…). createSQLQuery creates an SQL query, hibernate assumes that your query is already in sql format, then no other transformation is done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL-statement like this: SELECT name FROM users WHERE deleted = 0;
Hi I have following sql statement that gives me the the first_name and total
I have a sql statement that concatenates two columns, ItemNumber and Name, into one
I have the following SQL statement: SELECT ID, NAME FROM myTable WHERE ID LIKE
I have the following SQL statement: Select Choose(1,Orders.Employee, Orders.Customer) as Name1, Choose(2,Orders.Employee, Orders.Customer) as
I have sql statement one; select linkscat.id, linkscat.category from linkscat, contentlinks, links where contentlinks.linksid
I have this SQL statement: SELECT * FROM history WHERE (fk_person = 2119) AND
I have a SQL statement like the following: select A from table1, (select B
I have a SQL statement which returns a number of rows and these are
I have a sql statement that uses Difference => http://msdn.microsoft.com/en-us/library/ms188753.aspx I do this in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.