1 package org.hibernate.engine; 3 4 import java.util.List ; 5 import java.util.Map ; 6 7 import org.hibernate.FlushMode; 8 import org.hibernate.loader.custom.SQLQueryReturn; 9 import org.hibernate.loader.custom.SQLQueryScalarReturn; 10 11 17 public class NamedSQLQueryDefinition extends NamedQueryDefinition { 18 19 private SQLQueryReturn[] queryReturns; 20 private SQLQueryScalarReturn[] scalarReturns; 21 private final List querySpaces; 22 private final boolean callable; 23 private String resultSetRef; 24 25 public NamedSQLQueryDefinition( 26 String query, 27 SQLQueryReturn[] queryReturns, 28 SQLQueryScalarReturn[] scalarReturns, 29 List querySpaces, 30 boolean cacheable, 31 String cacheRegion, 32 Integer timeout, 33 Integer fetchSize, 34 FlushMode flushMode, 35 Map parameterTypes, 36 boolean callable 37 ) { 38 super( 39 query.trim(), 40 cacheable, 41 cacheRegion, 42 timeout, 43 fetchSize, 44 flushMode, 45 parameterTypes 46 ); 47 this.queryReturns = queryReturns; 48 this.scalarReturns = scalarReturns; 49 this.querySpaces = querySpaces; 50 this.callable = callable; 51 } 52 53 public NamedSQLQueryDefinition( 54 String query, 55 String resultSetRef, 56 List querySpaces, 57 boolean cacheable, 58 String cacheRegion, 59 Integer timeout, 60 Integer fetchSize, 61 FlushMode flushMode, 62 Map parameterTypes, 63 boolean callable 64 ) { 65 super( 66 query.trim(), 67 cacheable, 68 cacheRegion, 69 timeout, 70 fetchSize, 71 flushMode, 72 parameterTypes 73 ); 74 this.resultSetRef = resultSetRef; 75 this.querySpaces = querySpaces; 76 this.callable = callable; 77 } 78 79 public SQLQueryReturn[] getQueryReturns() { 80 return queryReturns; 81 } 82 83 public SQLQueryScalarReturn[] getScalarQueryReturns() { 84 return scalarReturns; 85 } 86 87 public List getQuerySpaces() { 88 return querySpaces; 89 } 90 91 public boolean isCallable() { 92 return callable; 93 } 94 95 public String getResultSetRef() { 96 return resultSetRef; 97 } 98 } | Popular Tags |