"dimar1975" wrote :
| The problem is that now the list contains Objects and not TaskList..I
need TaskList otherwise I will have ClassCastExceptions in other pieces of the
code..
|
|
Its going to return an Object array. You will have to change the return type
since you no longer
hello!
thank you very much for your advice.
Unfortunately I cannot follow your approach because the number of fields are
built at runtime - in other words the user creates at runtime a View of the
table.
I should add all possible constructors (they're about 20 fields :-( )
maybe I should create a
The following query
SELECT taskId, taskName FROM TaskList AS a
doesn't return list of tasks instead it will return list of objects, each item
in the list describes one row as another list of objects. Each item in the
latter list describes one column (e.g. taskName as String).
if you want it to r
I found one the following web site:
http://www.seamframework.org/Community/HowToDoTheJbossCache
that the query must be configure to be cached programatically. According to my
testing, it must be done in addition to the configuration in persistence.xml
with
|
|
| Query acc
Hi Dalibor,
The help is no problem, as i ran into quite a lot of these errors when i first
started using Hibernate + EJB3 + JBoss.
I also went with the Set to solve the "Multiple Bag" problem, as it seems the
easiest so long as it fits the data model. I think @CollectionId is a
hibernate spec
Hi Andy,
thanks a lot for your help. I really appreciate it.
Now, the Set solution seems to be most clean, but in stage of our project
I simply can't change this anymore...
Well, the third option @CollectionId, is this pure EJB3.0 Annotation or is it
part of Hibernate?
Thanks
Dalibor
View the
Hi,
The are a few ways that the multiple bag exception can be avoided.
You mentioned using a Set instead, this would solve the problem but it has the
restriction that it can only contain distinct values so you need to consider if
they will work for you.
Another solution would be to use Lists
Thanks Andy,
well, and how to avoid this multiple bags exception thing? I have read that I
should use Set instead of generic Collection, but is this solution?
Bye
Dalibor
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009467#4009467
Reply to the post :
htt
It is possible to keep fetching ahead, but you need to watch out for the
classic hibernate "Could not fetch multiple bags" exception. To do multiple
fetching, you will just need to use aliases, for example:
SELECT c FROM Customer c LEFT JOIN FETCH c.phones cp JOIN FETCH cp.
Cheers,
Andy
View
Hi Andy,
thanks a lot! It works! Now, how would you create SQL statement when every
Phone will have yet another collection ?
Customer -> Collection(Phone) -> Collection(Something)
Thanks
Dalibor
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008331#4008331
Hi,
In an EJBQL query you can fetch the collection by using a fetch join, such as
the following example (taken from Enterprise Java Beans 3.0)
SELECT c FROM Customer c LEFT JOIN FETCH c.phones
Where Customer is an entity containing a collection (relationship) of phones.
Cheers,
Andy
View th
It seems to be a bug.
I have the a similar problem in a other table.
The workaround that I use now.
I call anonymous wrote : createNativeQuery instead of anonymous wrote :
createQuery or anonymous wrote : find of the anonymous wrote : EntityManager.
The consequence is the field is not set to nu
label is a reserved word in MySQL.
I use this word as table name --> generates strange effects.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969287#3969287
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969287
___
13 matches
Mail list logo