I have a user with id 1 and name "A" and a group with id 24 and name "B".
They're in a relationship with an entry in the Join-table.
Then i update "A" by doing
| User u = new User();
| u.setId(1);
| u.setName("Z");
| manager.merge(u);
|
and after that the entry in the join-table is go
Hello,
I have two Entities, User & Group, in an m:m relationship, User is the owning
side, eager loading.
Problem: if i update a user entity, its relationships are destroyed. updating a
group works.
How can i solve this ?
View the original post :
http://www.jboss.com/index.html?module=bb&op=v
Don't you have a relationship on EJB level so you can do student.getSubjects()
instead of going through the trouble of doing a query? Looks awful complicated
to me :)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3953977#3953977
Reply to the post :
http://w
I think you get the ConcurrentModificationException because you remove objects
from the list while you're iterating over it.
If you go through the list with a simple
for (int i = 0; i < subjects.size(); i++)
maybe it will work?
View the original post :
http://www.jboss.com/index.html?module=b
if i go through the user's groups and delete the user from them before i delete
the user it works fine. Looks like it was repersisted through the cascading..
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3953888#3953888
Reply to the post :
http://www.jboss.
Hello,
I have the following problem:
I have a User entity with a ManyToMany relationship to Group, persist and merge
cascading.
I have a UserMgrBean session bean to access the Users.
If i delete a User with a relationship by calling
(umgr being a UserMgr instance)
| umgr.delete(umgr.get(1));
http://jira.jboss.org/jira/browse/EJBTHREE-508
You'll have to do without a composite key :)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3949805#3949805
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3949805
I've already read a few topics about the "cannot simultaneously fetch multiple
bags" problem in 4.0.4.GA, but it seems like it only applies to OneToMany
relationships.
I have an entity with 2 ManyToMany relationships, eager fetching, and i get the
same error.
The relationships are done with Li
Hello,
I have to use an old and big database in my application and it is best if i
don't change anything like column names and stuff.
Problem is, someone named a column "4_a_prinzip". Now if hibernate queries that
table i get the following error:
Caused by: java.sql.SQLException: [Microsoft][SQL
Entity Class:
| package ejbframe.entity;
|
| import javax.persistence.*;
|
| @Entity
| @IdClass(UserPK.class)
| @Table(name = "users")
| public class User {
|
| private int userId;
| private String name;
| private String password;
|
| @Id @GeneratedV
just realized the overiding happens because i used manager.merge instead of
manager.persist .
Doesn't solve my problem though..
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3934998#3934998
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=po
I tested the same beans with new Jboss 4.0.4CR2 + EJB3CR6, the only thing
that's different is that i get no errors, because the row with id 0 is simply
overridden by each new entity that is added to the database. (no errors there!)
No HIBERNATE_SEQUENCES table is created either.
Could you be so
apparently hibernate does not create an entry in HIBERNATE_SEQUENCES for my
Bean with the PK class, but for the same one without pk class..
Uhm.. can you give me a hint on how to find a test suit that tests this.. ? (no
clue of them test suits :o)
View the original post :
http://www.jboss.com/
(the class has @IdClass with appropriate PK-class)
| @Id @GeneratedValue(strategy=GenerationType.TABLE)
| public int getUserId() {
| return userId;
| }
|
leads to a
java.sql.BatchUpdateException: failed batch
on the 2nd insert into the database.
1 Entity is wrote
i thought i wouldnt declare them as NamedQueries, but only as plain Strings in
the stateless's methods.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3934288#3934288
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=39342
thanks alot, this quits my worries
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3934294#3934294
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3934294
---
This SF.Ne
uh, there is one? tried several things with @GeneratedValue Annotation, but the
only id i got generated was 0 :o
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3934291#3934291
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply
well, but i have about 300 named queries if i do it with them, so i'm not sure
if thats really the way to go..
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3934276#3934276
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p
Is it better to have lots of NamedQueries (distinguished by class, eg
"Team.findAll" ) or to have Stateless Beans that execute the queries?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3934241#3934241
Reply to the post :
http://www.jboss.com/index.html?mod
i thoguht so. do you have an idea for working solution? i'd be very thankful :)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3934141#3934141
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3934141
-
I think it's surprising that there's so little about composite primary keys
with auto generated values yet..
Isn't it also possible that, evertime you add a new entry to the database you
do a query like (Role is the entity i tried with)
| "SELECT MAX(r.roleId) + 1 FROM Role r"
|
and take i
that would interest me a lot too, because i'm going to port many ejb 2.0
entities that use value objects to ejb 3.0 and i'm not sure if it's good to
keep the value objects either.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3932419#3932419
Reply to the pos
hmm works with mysql..
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3928709#3928709
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3928709
---
This SF.Net email is
Hello,
i wrote a very simple Entity Bean with a few cmp fields. I want the bean to
store the fields in my postgreSQL database.
I have put the postgres-ds.xml properly into the deploy folder with JNDI name
PostgresDS.
in jbosscmp-jdbc.xml i specified:
|
|
| java:PostgresDS
|
hello,
I'm using JBoss 4.0.3SP1 with Elcipse 3.1 Jboss IDE 1.5.
I wrote a simple EntityBean which seems to deploy fine (no errors).
But when i try to access it with my test client app, i get the following error
javax.naming.CommunicationException: Failed to retrieve stub from server
192.168.10.16
I wrote a very simple stateless session bean to test the IDE.
It only has 1 business method and i followed the steps in the java boss IDE
tutorial to set up the jndi-name etc and it deploys fine.
Then i wrote a simple client application in java, that is supposed to call that
1 method.
But i get
still the same error as before
| org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml :
datasource-mapping MSSQLSERVER2000 not found
|
with a fresh install (standard files are all standard)
nowhere in my files "MSSQLSERVER2000" is mentioned! i only use "MS
SQLSERVER2000"
Okay thanks a lot that seems to have done the trick with the database.
thanks alot!
got another error now tho ;)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3926762#3926762
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply
i took fresh files and removed the entry from mssql-ds.xml
still the same error. :(
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3926754#3926754
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3926754
-
if i do that the error message changes to
org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml :
datasource-mapping MSSQLSERVER2000 not found
which is the name from before :o
seems like a quandary to me
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewto
is there an edit button in this forum??
the error message i get (i get about 100 of the same type, but i'll post only 1
:-) )
| org.jboss.deployment.DeploymentException: Error: can't find data source:
java:/MSSQLDS; - nested throwable: (javax.naming.NameNotFoundException: MSSQLDS
not bound)
Hello,
I'm trying to run JBoss 4.03SP1 together with MS SQLSERVER 2000 for a company
page using JSP.
But I'm stuck on configuring the database.
I donwloaded and installed the JDBC drivers for MSSQL2000.
my mssql-ds.xml looks as follows:
|
|
| MSSQLSERVER2000
|
jdbc:micro
32 matches
Mail list logo