1. Disabling Alias names while parsing query forum.hibernate.orgHi, when hibernate parses the query it creates alias name for each column which may be more than 18 characters. DB2 on mainframe doesn't allow alias names more than 18 chars. Is there a way of disabling this? Rgds, Matt [3/27/04 16:44:17:482 GMT+05:00] 427576 JDBCException W cirrus.hibernate.helpers.JDBCExceptionReporter SQL Error: -107, SQLState: 42622 [3/27/04 16:44:17:501 GMT+05:00] 427576 JDBCException E cirrus.hibernate.helpers.JDBCExceptionReporter [IBM][CLI Driver][DB2] ... |
2. Alias forum.hibernate.org |
3. Undefine Alias error forum.hibernate.orgSELECT d, p.price FROM StateDestinationData sd, DestinationData d, OfferData o, PackageData p WHERE sd.stateId = "+stateId+" AND sd.destId = d.destId AND d.destId = o.destId AND o.offerId = p.offerId " p.price = (SELECT min(price) FROM PackageData WHERE offerId = o.offerId) ORDER BY d.destName ASC ... |
4. Alias doesn't correspond to any of the supplied return alias forum.hibernate.orgHi, Iam getting an exception when Iam using the sql query as follows, select {cvo.customeridvc,cvo.customernamevc,cvo.shortnamevc,cvo.creditstatusvc,cgvo.groupnamevc,evo.lastnamevc} from customer as {cvo} left outer join customergroup as {cgvo} on cgvo.custgroupidvc=cgvo.custgroupidvc The exception as follows, ERROR [STDERR] net.sf.hibernate.QueryException: Alias [cvo.customeridvc,cvo.customernamevc,cvo.shortnamevc,cvo.creditstatusvc,cgvo.groupnamevc,evo] does not correspond to any of the supplied return aliases = {[cvo]} [select {cvo.customeridvc,cvo.customernamevc,cvo.shortnamevc,cvo.creditstatusvc,cgvo.groupnamevc,evo.lastnamevc} from customer as {cvo}left outer join customergroup as {cgvo} on (cvo.custgroupidvc=cgvo.custgroupidvc) ... |
5. alias in HQL forum.hibernate.org |
6. Column alias needed ? forum.hibernate.org |
7. Errors: undefined alias:... forum.hibernate.orgI got the following errors 4 time. There are 4 records in the DEPT table. omain.Dept] 07:59:11,177 DEBUG - [ora.EmpDaoSql.findListDept] net.sf.hibernate.QueryExceptio n: undefined alias: DEPTNO [SELECT DEPTNO, DNAME FROM edu.umich.umms.my_spring.d omain.Dept] My code is:------------------------------------------------------ String sqlString = "SELECT DEPTNO, DNAME FROM Dept"; Session sess = getSession(); try { resultList = sess.find(sqlString); if (resultList != null) { lst = new ArrayList(); } ... |
8. Incorrect alias resolution for Expression forum.hibernate.org |
9. SQL queries, aliases and objects with relations forum.hibernate.orgHello, I have a question concerning mapping results of hibernate SQL queries to objects that have relations to Other objects (one to one, one to many etc.). Lets assume that I have to objects that are mapped to different tables and their relation is one-to-one (both related rows have the same primary key). public class Debt { private Integer id; private ... |
10. Specifying multiple aliases for SQL query forum.hibernate.orgI am relatively new to Hibernate. I need to write a SQL query that involves multiple objects and multiple underlying tables. I have been struggling with specifying multiple aliases and classes in |
11. HQL-undefined alias forum.hibernate.orgCode: Session s = sessions.openSession(); Transaction ts = null; //User u1= new User(); List result = null; ts = s.beginTransaction(); Query ... |
12. Can all aliases/columns be quoted? forum.hibernate.orgHi, I am trying to run the Hibernate unit tests with Informix. Here is one problem I have come across. Informix changes all column and alias names to lowercase. In the connection string you can specify one of two modes depending on the DELIMIDENT parameter: - Allow quoted identifiers for column names etc. This is necessary to pass various Hibernate tests ... |
13. mutiple aliases for same collection in a Criteria forum.hibernate.orgIn a many-to many relationship between Cat and Dog entities I am given a collection of dogs, and need to find a collection of cats where each cat is related to all given dogs. One way of doing it is to join a Cat entity with Dog entity dogs.size() times, but I can't get it to work with Criteria.createAlias() or createCriteria() ... |
14. Alias for select elements(...) ... where ? forum.hibernate.orgI have a classe (Business) that holds a map of images (ImageFile) that are just compoents. The ImageFile has a name and byte[]. In the servlet that displays only one given image, I try to select that image only given it's name, and the Business id : Code: select elements(business.images) from Business business where business.id='ff808081feac148000feac178cb20003' and name='logo1.gif' This works fine until ... |
15. column aliases -- the SQL I am using doesn't support them forum.hibernate.org |
16. MySQL parse exception, alias in where clause not supported. forum.hibernate.org |
17. duplicate alias in generated SQL raises JDBC exception forum.hibernate.orgIn the first post I've mentioned that the fields causing the problem are in the generated SQL sequence. Two columns (adresse1_.adresse1 and adressefou0_.adresse) that have the same alias but different types (String and long). All I'm interested in is to find out why hiberete generated that SQL sequence using the same alias "adresse10_" for two columns. |
18. Column alias not supported with db2/vm (sql/ds) database forum.hibernate.org |
19. Assigned aggregate value of inner select to an alias forum.hibernate.orgHibernate version: 2.1.1 Name and version of the database you are using: Oracle 9i I am trying to figure out how to, or a better way to do an inner select with an aggregate function to an alias. I have 3 tables and table 2 and 3 are children of table 1. I'm trying to do a sum() on a column ... |
20. undefined alias error on the SQL forum.hibernate.org |
21. Bug in hibernate column alias generation forum.hibernate.orgSenior Joined: Sun Jan 04, 2004 2:46 pm Posts: 147 Hibernate version: 2.1.6 Mapping documents: |
22. Invalid Column due to alias mismatch for formula property forum.hibernate.orgFor the "Deposit" property I'm using a formula to retrieve a value from 1 of 2 DB columns. I debugged and found that the column name DEPOSIT_9_0_ is passed to DoubleType.get(ResultSet rs, String name) rather than f0_0_ which causes an Invalid Column error to be thrown. So it looks like the "f" prefix is used for the alias, but not when ... |
23. Alias to Entity mapping problem forum.hibernate.orgHibernate version: 2.1.6 Name and version of the database you are using: MSSQL Server 2000 SP3 with jtds as the JDBC driver I am trying to use Criteria to retrieve information from my database. My criteria query is below. Everything seems to work fine with what it is doing, the base element that is returned is what I expect. The problem ... |
24. Table Aliases forum.hibernate.orgThe query generated is doing a full table scan. After discussing with our DBA's, we came to the conclusion only way to make it use the index is to use Oracle hints. The hint we have to use id /* use_nl (alias name) */. Since the alias is generated by Hibernate, I am not sure what to give in the "alias ... |
25. Setting column aliases ( " , expected in SELECT ...&quo forum.hibernate.org |
26. Table alias problem in generated SQL forum.hibernate.orgI am using Hibernate to persist objects where the class name is "Order". Hibernate generates SQL that cannot execute due to the use of "order" as an alias. "Order" being an SQL keyword, the following error is generated: "BY expected after GROUP or ORDER: where [from com.x.y.z.businessModel.core.Order as [b]order[/b] where order.id=?]" Is there any way of controlling the alias that hibernate ... |
27. Impact of aliases on database problem identification forum.hibernate.orgNewbie Joined: Thu Apr 22, 2004 8:33 am Posts: 6 We are using Hibernate 2.1 and have some rising concerns regarding its behaviour in error cases. Problem 1: Impact of aliases on database problem identification Hibernate is systematically using generated aliases, for every table and column. Everything works fine if the mappings files and the database structure are in line, but ... |
28. Table alias problem with order-by of set forum.hibernate.orgUsing Hibernate 2.1.4, Xdoclet 1.2.2 and following code fragment: [code]/** * @hibernate.set lazy="false" order-by="DISPLAY_ORDER asc" * @hibernate.jcs-cache usage="read-write" * @hibernate.collection-key column="PROFILE_ID" * @hibernate.collection-many-to-many column="COLUMN_ID" class="model.Column" outer-join="true" */ private Set getColumns() { return m_columns; } [/code] where DISPLAY_ORDER is a field of the model.Column tabel gives following hbm.xml content: [code] |
29. query error:net.sf.hibernate.QueryException: undefined alias forum.hibernate.orgRead the rules before posting! http://www.hibernate.org/ForumMailingli ... AskForHelp I am using Hibernate with Struts. I was able to run a query just fine until I decided to use the getNamedQuery method in my class, along with a named parameter. Now I am getting an error of undefined alias. This query was working fine as long as it was stored in a ... |
30. getnamedquery ..hibernate.QueryException:undefined alias forum.hibernate.orgNewbie Joined: Fri Feb 04, 2005 4:11 pm Posts: 10 Read the rules before posting! http://www.hibernate.org/ForumMailingli ... AskForHelp [I am using Hibernate with Struts. I was able to run a query just fine until I decided to use the getNamedQuery method in my class, along with a named parameter. Now I am getting an error of undefined alias. This query was ... |
31. Change alias names in a Criteria query forum.hibernate.orgDoes anyone know if, and how, you can change the alias name that a Criteria uses for a column? In other words, in the actual From part of the SQL, by default it uses the column element from the property in the hbm.xml file to derive an alias. I just wanted to know if it is possible to over ride how ... |
32. Arithmetic expressions in Select and using alias forum.hibernate.orgHi, I am using Hibernate 2.1 and database PostgreSQL 7.4. Does Hibernate support using arithmetic expressions in a HQL query ? When using the following HQL: select c.name, (c.cost1+c.cost2+c.cost3) from Claimant c order by totalcost I get the following exception: net.sf.hibernate.QueryException: aggregate function expected before ( aggregate function expected before ( in SELECT What I actually need to do is the ... |
33. Criteria query on same association twice with aliases forum.hibernate.orgOk, five struggling hours later... I have tried to use a |
34. Alias names too long for DB2 forum.hibernate.orgNewbie Joined: Mon Apr 18, 2005 10:02 am Posts: 14 Location: Zrich, Switzerland Hi there, I seem to have a problem with alias names that are too long: Hibernate version:3.0 DB2 Version 7 [4/18/05 15:33:33:363 CEST] 7738cb43 SystemOut O Hibernate: select porexclusi0_.ID as ID1_, porexclusi0_.ADEXLLABUEXCLPCOM as ADEXLLAB2_32_1_, porexclusi0_.ADEXLEXGRAPAYCOM as ADEXLEXG3_32_1_, porexclusi0_.ADEXFINPOLACCCOM as ADEXFINP4_32_1_, porexclusi0_.ADEXLGRPOLCONCOM as ADEXLGRP5_32_1_, porexclusi0_.ADEXLHIDEDPOLCOM as ADEXLHID6_32_1_, porexclusi0_.ADEXLLPORTRACOM as ... |
35. Query.setLockmode(): alias? forum.hibernate.orgI'm using Hibernate 3.0.3 with Oracle 10g. I try to build a HQL-Query which locks the loaded objects. My approach looks like that: Code: Query q = session.createQuery("FROM Test as test where attr = 'test'); q.setCacheMode(CacheMode.IGNORE); q.setFetchSize(this.fetchSize); ... |
36. HQL Without using alias forum.hibernate.orgHibernate version: 3.0.1 Name and version of the database you are using: Oracle 10g If I use HQL and forget to use an alias on the joined class, then the sql generated adds an extra join with this table for any condition on it. If i have the HQL select count(*) ,sum(movs.mtoOpe) from ClassTotal actual left join actual.movimientos movs where movs.fchOpe ... |
37. order by using an alias for a count function? forum.hibernate.orgHello. My name is Sorin I am using Hibernate 2.1.7 I have the following HQL query: |
38. Hibernate fetching wrong alias name in result set forum.hibernate.orgI'm executing an Hibernate query with an operation in the select clause: select avg(mark.score*rating.ratingQuality), avg(rating.ratingQuality) from Mark as mark join mark.rating as rating join rating.product as product where product.id = ? and rating.approved = " + Rating.APPROVED and rating.creationDate>=? and rating.creationDate group by mark.id The query gets executed without any problem. I also tested the corresponding generated query in MySQL and ... |
39. Getting current table alias in a filter forum.hibernate.orgHibernate version: 3.0.5 Name and version of the database you are using:SQL Server 2000 I'm trying to use a subselect in a filter, but the problem I have is that the main table and a table in the subselect have a column with the same name. SQL Server uses the subselect table for that column, but I need the main table ... |
40. Collisions between identifier and property aliases forum.hibernate.org |
41. undefined alias forum.hibernate.orgI keep getting this error INFO: org.springframework.orm.hibernate.HibernateQueryException: undefined alias: fileN [SELECT fileN,workItemTyC,workItemSbtyC,accN,usTaxIdN,orgId,orgNm,creD,lstEvtD,archD,workDesc,nysePrblC,nysePrdC,fstNm,lstNm,xmlXSz,tsfString FROM com.fmr.xtrac.hibernate.TTkawArchWorkItem WHERE orgId = ? AND workItemSbtyC = 'DUSA']; nested exception is net.sf.hibernate.QueryException: undefined alias: fileN [SELECT fileN,workItemTyC,workItemSbtyC,accN,usTaxIdN,orgId,orgNm,creD,lstEvtD,archD,workDesc,nysePrblC,nysePrdC,fstNm,lstNm,xmlXSz,tsfString FROM com.fmr.xtrac.hibernate.TTkawArchWorkItem WHERE orgId = ? AND workItemSbtyC = 'DUSA'] Here is the code I am using List WorkItemSearchResultList = _hibernateTemplate.find( "SELECT fileN," + "workItemTyC," + "workItemSbtyC," + "accN," + ... |
42. Criteria eager fetching of collection with alias forum.hibernate.orgI'm using the Criteria API with Hibernate 3.0.5. I would like to eagerly fetch a collection via setFetchMode, but I also need to add a restriction from the associated table, like so: Code: Criteria criteria = session.createCriteria( Relation.class ); criteria.setResultTransformer( Criteria.DISTINCT_ROOT_ENTITY ); criteria.setFetchMode( "relationLink", FetchMode.JOIN ); criteria.createAlias( "relationLink", "rl" ); criteria.add( Restrictions.ilike( "rl.personId", personId, MatchMode.START ) ); return criteria.list(); If I ... |
43. Is it possible to use a custom SQL Alias generator ? forum.hibernate.orgVersion 3.0.5 Because my SQLs are not very complicated, so I decided to give it a try with Derby(Cloudscape). Now I have a big problem. I have found that Derby does not support alias which is ended with "_", like "select emp_.name from Employee as emp_". It seems to be wrong in Derby. But my Hibernate happens to generate the alias ... |
44. Criteria {alias} needs inheritance forum.hibernate.orgI am using the Criteria query with Restrictions.sqlRestriction(). The "{alias}" is very handy, but it substitutes the name of the primary class. I need it to substitue the name of one of the superclasses. Is there some way to do this? Could it be changed to "{entity.property}" to refer to the property on the class or superclass? |
45. Every derived table must have its own alias forum.hibernate.orgHi, I am trying to move an application over to MySQL from Oracle. For most of the application things seem to be working well but when I try and view a particular jsp page which via a dao performs a very simple query I get an error. I never got this when running with Oracle. I am wondering if it's not ... |
46. alias for a discriminator column in native SQL forum.hibernate.org |
47. Expression.SQL alias problem with joined subclass forum.hibernate.orgNewbie Joined: Wed Apr 13, 2005 12:00 pm Posts: 5 Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp I am trying to perform a case-insensitive LIKE query against the "name" property of a joined subclass. The property actually exists in the parent class. It works fine for non-joined subclasses (including the parent class of the joined subclass). Quote: Expression.sql("lower({alias}.name) ... |
48. createSQLQuery() undefined alias for table per subclass forum.hibernate.orgHibernate creates an undefined table alias(?) for the subclass table. I am unable to get native sql to work for my subclass mapping. Activity is an abstract class with one abstract method. Basically no subclasses add properties. I just want the correct subclass returned. Mapping worked in createQuery(). I don't want to use createQuery because that blows up trying to parse ... |
49. Quote an alias or property in HQL (not SQL)? forum.hibernate.org |
50. Using an alias in |
51. property formula issue: adding unwanted alias forum.hibernate.org |
52. hql - alias? to capture calculation forum.hibernate.orgHibernate version: 3.1 Name and version of the database you are using: mysql 5 I have this great hql below. I want to also capture the distance being calculated as well. Currently the resultset is a Business object. Is there a simple way to do a alias or something and have the distance set on my Business object as well? String ... |
53. Inherited variable is referenced by child table alias forum.hibernate.orgBeginner Joined: Tue Feb 01, 2005 5:26 pm Posts: 24 Location: dallas Hibernate version: Hibernate version no 3.0 Inherited variable is referenced by child table alias in hibernate generated sql when used in where clause of a set tag to filter the collection. Here the variable 'IS_DELETED' is referenced by child table alias 'cats0_' rather than parent alias 'cats0_1_'. Is it ... |
54. Best practices for search/multiple alias per table forum.hibernate.orgNeed help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.0 Name and version of the database you are using: SQL 2000 I am trying to figure out the best way to implement the following search. It is simplified of course for example sake, there are a lot of tables that come into play before getting to those three. ... |
55. problem with HQL alias forum.hibernate.org |
56. Duplicate column aliases with ternary associations forum.hibernate.orgNewbie Joined: Wed Jan 04, 2006 12:52 pm Posts: 4 When trying to eagerly fetch a ternary association (mapped as suggested in Hibernate in Action), we are seeing multiple column aliases in the generated SQL. Sybase does not tolerate these, and even our dummy HSQLDB instances seem to have problems when the number of replicates gets high, silently failing with zero ... |
57. DB2390Dialect: alias to long forum.hibernate.orgSessionFactory sessionFactory = HibernateUtil.getSessionFactory(); Session session = sessionFactory.getCurrentSession(); Query query = session.createQuery("from Budget as budget where budget.produktId = :produktId").setParameter("produktId", new Long(engagementsEntry.getId()), Hibernate.LONG); List budgetter = ... |
58. named query alias is not mapped forum.hibernate.orgI have a named query using hibernate 3 that is giving me an error saying that my alias is not mapped. I am using XDoclet to generate the hibernate xml. Here is the xdoclet tags. @hibernate.class table="csr_user" discriminator-value="USER" @hibernate.query name="findByUsername" query="from USER m where m.username = :username" this is the relevant snippets that xdoclet generates from User.hbm.xml |
59. Native SQL : DELETE doesn't take Alias, Possible Bug forum.hibernate.org |
60. Using Projection.groupProperty() with alias forum.hibernate.orgNewbie Joined: Fri May 05, 2006 2:52 pm Posts: 1 Hi everyone, i've been using hibernate and some days ago i tried to use it with a VIEW. In the view i put a rownum to be the unique id and mapped it with a primary key. Ok this is working! This View has a lot of fields, let me say ... |
61. Problem with column alias and order by clause forum.hibernate.org |
62. criteria group by alias forum.hibernate.orgThank You for your reply. Its my fault that I started the confusion about group by and order by. However, let me explain my situation I have the following: select trunc(this_.END_DATE, 'DD') as DAILY, min(this_.PH) as y1_, avg(this_.PH) as y2_, max(this_.PH) as y3_, stddev(this_.PH) as y4_, count(this_.PH) as y5_ from water_quality_measures_mv this_ where this_.SITE_ID='xxxxxxx' and this_.END_DATE between to_date('x/x/xxxx','mm/dd/yyyy') and to_date('x/xx/xxxx','mm/dd/yyyy') group ... |
63. Access to association aliases within criteria query API forum.hibernate.orgI'd like to have a custom generic text search criteria extended from AbstractCriterion that would allow to search all string-based properties of an instance and its ASSOCIATIONS. Problem is that I couldn't find a way to access aliases for associactions so that LikeExpressions could be converted to sql string properly. Is it possible? Example criteria query ignores associations, probably for this ... |
64. Subquery alias help! forum.hibernate.orgI have two tables, a "site" table for websites and a "health" table for the website health status recorded at the certain intervals. I need to query for currently active websites (status: up). This is the SQL I have: select s.* from site s left join health h on s.id = h.site where h.status = ? and h.time_of_last_update = (select max(q.time_of_last_update) ... |
65. Stopping table alias on discriminator formula forum.hibernate.orgSeems I might have to edit the org.hibernate.sql.Template class to include the keyword passing and except " as a quote token. Or is there another way through Hibernate properties in the mapping document? If I have to edit Template then handling the passing keyword isn't problem but dealing with double quotes as a token might be. After looking at the Template ... |
66. Alias Problem forum.hibernate.orgBeginner Joined: Mon Jul 26, 2004 4:29 pm Posts: 45 Location: TX, USA One way to solve your problem would be to map the sub-select as an entity. Take this example of widgets which have an associated set of gadgets: SQL: Code: -- drop the tables first drop table gadgets; drop table widgets; drop table widget_gadget; -- create the tables create ... |
67. Concept: what is "Alias" and "Projection'? C forum.hibernate.orgThis is a conceptual question, please feel free to point me to any tutorials or docs that explain this, but I haven't found them. I can RTFM and read the APIs, but only when I understand the concepts behind the terms. I am well versed in SQL functionality and DB concepts, so if anyone can explain Alias and Projection in terms ... |
68. wrong sql generated by setMaxResult() with db2 and use alias forum.hibernate.orgNewbie Joined: Mon Feb 27, 2006 12:02 pm Posts: 8 Hi. I have a problem with hibernate generated invalid sql when using setMaxResult() with DB2 and the query has alias name Hibernate version: 3.1.3 Mapping documents: Code: |
69. [solved] Criteria: adding alias to criteria breaks fetchmode forum.hibernate.orgHello, we are using Hibernate for about 8 months now, 2 of those even in production, and didn't have any problems with it at all. But recently I encountered the following issue (I don't know if its my fault or a bug). I am using the criteria API for a search screen (multiple tables are involved, restrictions may be applied to ... |
70. problems with sqlRestrictions and alias forum.hibernate.orgNewbie Joined: Tue Sep 19, 2006 6:47 am Posts: 15 Hi everybody, I try to use sqlRestrictions but have a problem using it with an alias table. In fact I use several aliases in my criterion. It seems to me that {alias} is replaced by the first alias table name that is found and I don't know how to give the ... |
71. Column aliases change from HQL to SQL automatically. help forum.hibernate.orgMaybe the HQL parser is thrown off by 'length' as being a possible function. It seems that this is an arbitary alias name, can you change the name and see if the parser behaves differently? For example len, _length. Just a quick suggestion, may not work but easy enough to try... Marius |
72. SQL error with native SQL using column aliases forum.hibernate.orgNewbie Joined: Wed Nov 22, 2006 1:32 pm Posts: 8 Description In my project I am using OpenGeoDB (unmapped). Now I want to get some data from there using native sql. However I get "java.sql.SQLException: Column 'text_val' not found. " when I define column aliases (see log below). Can anyone help, please? Is this a bug? The query works fine if ... |
73. column aliases for non-managed entities forum.hibernate.orgSection 16.1.5 from the Hibernate (3.2) Reference Guide shows an example of using a ResultTransformer on the results of a SQL query to populate the properties of a non-managed entity. This is almost exactly what I need to do, but I need to also specify an alias to map between a field in the result set and a property of the ... |
74. Alias Length Problem with Column.getAlias forum.hibernate.orgI have a length problem with the aliases generated by org.hibernate.mapping.Column. The are sometimes too long. First, Column.getAlias(Dialect dialect, Table table) doesn't consider Dialect.getMaxAliasLenght() at all. These aliases are easily longer than Dialect.getMaxAliasLenght(). Second, even Column.getAlias(Dialect dialect) has the following Problem: Given the column named "ABCDEFGHIK_X", Dialect.getMaxAliasLenght()=10 and uniqueInteger=12, you'll get the alias "ABCDEFGHIK12_" which is way over 10 characters (13 ... |
75. Why invalid table aliases ? forum.hibernate.orgAuthor Message koqiui Post subject: Why invalid table aliases ? Posted: Sun Jan 28, 2007 6:34 am Newbie Joined: Wed Jan 10, 2007 6:19 am Posts: 2 Location: China decription: Integrating Spring with Hibernate :-< the underlying database table "modules" was intepreted to "__modules", not the expected "modules" Why so ? email to : koqiui2008@msn.com THANK YOU ! jdk ... |
76. Alias name generation and stored outlines within oracle forum.hibernate.orgHibernate version: 3.0.5 Name and version of the database you are using: Oracle 9 The SQL statements generated by Hibernate contain alias names for the columns consisting of some letters from the column name and three numbers. The second number differs under certain circumstances. If I change the JVM or if the generation is done inside or outside an application server, ... |
77. How to get alias while setting d fetchmode using criteria? forum.hibernate.org |
78. elements() in simple HQL requires object alias? forum.hibernate.orgI'm using a simple named query to search for all objects that have a given value-element in a set. It works if I alias the object, but not if I don't. In the code below, query OrganisationsByType1 produces the given exception, OrganisationsByType2 works perfectly. I've done a quick search through this forum and through JIRA, but I couldn't find anything like ... |
79. SQL Server + alias in where clause = Invalid column name ? forum.hibernate.orgNewbie Joined: Sat Apr 07, 2007 12:08 pm Posts: 6 Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.2.0GA (as shipped with JBoss 4.0.5) Mapping documents: None, annotated class instead: Code: @Entity public class Company implements Serializable { protected String shortName; public String getShortName() { ... |
80. URGENt -->create alias collection forum.hibernate.orgThis should work for you: Code: criteria.createCriteria("degrees", "jsdegrees"); Set schoolSet = new HashSet(); schoolSet.add(school); Set schoolDepSet = new HashSet(); schoolDepSet.add(department); Set postGradDegreeSet = new HashSet(); postGradDegreeSet.add(postGraduateDegreeType); criteria.add( Restrictions.disjunction() .add( ... |
81. hql: group by and alias forum.hibernate.org |
82. Alias not working in DetachedCriteria forum.hibernate.orgProjectionList pl1 = Projections.projectionList(); DetachedCriteria c = criteriaExport.createCriteria("PrcsSet", "Prcs"); c.setProjection(pl1.add(Projections.property("Jobs.".concat(Jobs.PROP_ID))).add( Projections.property("Jobs.".concat(Jobs.FILE_NME))).add( Projections.property("Jobs.".concat(Jobs.CUST_ID))).add( Projections.property("Jobs.".concat(Jobs.CLNT_ID))).add( Projections.property("Jobs.".concat(Jobs.FIL_CAT))).add( Projections.property("Jobs.".concat(Jobs.FIL_TYP))).add( Projections.property("Jobs.".concat(Jobs.JOB_NME))) ); c.add(Expression.eq("Jobs.".concat(Jobs.CUST_ID), expCriteria.getCustId())); c.add(Expression.eq("Jobs.".concat(Jobs.CLNT_ID), expCriteria.getClntId())); c.add(Expression.eq("Jobs.".concat(Jobs.FIL_CAT), expCriteria.getFileCat())); c.add(Expression.eq("Jobs.".concat(Jobs.PRCS_TYP), Constants.PRCS_TYP)); c.add(Expression.eq("Prcs.".concat(Prcs.PRCS_SQNCE), Constants.PRCS_SQNCE))); List resultList = c.getExecutableCriteria(session).list() |
83. DB2 Alias names too long forum.hibernate.orgNewbie Joined: Fri May 18, 2007 9:57 am Posts: 2 I am getting DB2 SQL error: SQLCODE: -107 (name too long) exceptions when trying to select rows based on Many-to-one or one-to-many relationships. Looking at the generated sql I can see that the Alias name generated for the TimeStamp column is one character too long for DB2's max of 18. The ... |
84. alias not found forum.hibernate.orgI have the following code to make sure that the query does not acquire an exclusive lock on the database tables. query=session.createQuery("select count(*) from prh a " + " where a.prn = :form_nbr " + " and UPPER(a.gsi) = :othr"); query.setLong("form_nbr",form_nbr); query.setString("othr","OTHR"); query.setLockMode("a",LockMode.NONE); The code compiles and builds fine, but when I run it, it throws the following exception: exception: alias ... |
85. Col alias not unique using multiple LEFT JOIN FETCHs forum.hibernate.orgI don't think you've given enough information. A simple test with a LEFT JOIN FETCH to a set of integers works fine (3.2.4sp1 hsqldb & mysql). SQL you posted looks wrong so probably not a database specific issue. Mike ZoneContainer.java Code: package test.mdlandon; import java.util.Set; public class ZonesContainer { private Long id; private Set zones; ... |
86. Hibernate accesses unmapped alias column name forum.hibernate.orgHibernate operation: could not execute query; uncategorized SQLException for SQL [..]; SQL state [null]; error code [-99999]; Invalid argument: unknown column name id18_0_; nested exception is com.ibm.db2.jcc.c.SqlException: Invalid argument: unknown column name id18_0_ Caused by: com.ibm.db2.jcc.c.SqlException: Invalid argument: unknown column name id18_0_ at com.ibm.db2.jcc.c.m.a(m.java:1262) at com.ibm.db2.jcc.c.rc.a(rc.java:1368) at com.ibm.db2.jcc.c.rc.getLong(rc.java:1161) at ... |
87. Problem with "order by': the alias is lost in the SQL forum.hibernate.org |
88. Alias and formula sql query -subquery forum.hibernate.org@Formula("( select subqry.rank from ("+ "SELECT ph1.PH_ID,ph1.PH_PROTOCOL_ID,"+ "DENSE_RANK () OVER (PARTITION BY ph1.ph_protocol_id ORDER BY ph1.ph_history_date asc ) rank"+ " FROM pm_protocol_history ph1)subqry "+ ... |
89. Criteria - how to use created Alias in sqlRestriction forum.hibernate.org |
90. How to create alias for property in sql restriction forum.hibernate.org |
91. Create a new Criteria instance with two given aliases forum.hibernate.orgHello everyone, I wanted to ask a simple thing. I have a query like this: SELECT node.name FROM nested_category AS node, nested_category AS parent WHERE node.lft BETWEEN parent.lft AND parent.rgt AND parent.name = 'ELECTRONICS' ORDER BY node.lft; As you can see two aliases are created for the same table, how can I do this with hibernate criteria? thanks in advance Mario ... |
92. how are column alias names generated? forum.hibernate.orgOkay dont beat me up too bad, this is my first time posting on this forum. My lead is thinking of trying to lock oracle 10g plans for hiberante queries. I was looking at the generated sql and I see some items that make me nervous. One thing is the column aliases. For example: select alertdo0_.DC_ALERT_SYSID as DC1_23_, alertdo0 Where does ... |
93. alias problem forum.hibernate.org |
94. Disable column alias when generating SQL forum.hibernate.orgWe are using DB2 Everyplace, which is a lightweight edition of DB2. It do not support SQL with column alias. May I know if Hibernate can be configured to disable the column alias when generating SQL? If can't or not supported by default, any suggested ways to amend or extend Hibernate source code to achieve this? |
95. Criteria sqlRestriction using created aliases forum.hibernate.org |
96. AliasToBeanResultTransformer alias mapping strategy forum.hibernate.orgclass PersistantClass1 { private string label; private PersistantClass2 parent; //...dozen of other properties...; //getters/setters } class PersistantClass2 { private String parentLabel; private int parentOrder; //...dozen of other properties...; //getters/setters } |
97. Two aliases for a table in a single query forum.hibernate.orgHibernate version: 3.1 Name and version of the database you are using: Oracle 10g We use Hibernate in our application and now we need to cross data from a table with itself. In other words, we need to do queries that support multiple aliases for a single class, as the following exemple: "select classAA.classB.seq and classAA.classB.data from ClassA classAA, ClassA classAB, ... |
98. Example criteria on alias forum.hibernate.orgMDiaz, You are mixing a couple of issues in your question. To clarify: -the example query's purpose is to contain parameters already set, a function that, in your case, we assume the "cat" object has already been created for elsewhere. -you cannot, on your cat object, place restrictions on the "mate" property simply using cat.mate.propertyA=xxx, assuming mate is a property of ... |
99. how to set alias for example criterion forum.hibernate.orgHibernate version:3.2.6 Name and version of the database:Oracle 10g I'm getting the same error and have the same query setup, i.e., some restrictions followed by some projections. I've narrowed down the problem to occurring when a field is present in both the projections and the restrictions. Removing the field from either makes it work. Example 1. Restrict on foo Project on ... |
100. Fill order clause with an alias with a Dialect forum.hibernate.org |