-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Why .ELT in @ManyToMany annotation
PostPosted: Mon Aug 28, 2006 12:06 pm 
Newbie

Joined: Sat Feb 26, 2005 11:45 am
Posts: 13
Location: Stockholm, Sweden
Hibernate version: 3.2.0.cr1
Hibernate annotation version: 3.2.0.CR1

Please help !!!!

Im getting frustrated.
Following the hibernate documentation exactly to be able to set up a @ManyToMany relationship an Authority and Action class.

Authority.java
@JoinTable(
name="AUTHORITY_ACTION",
joinColumns={@JoinColumn(name="authority_id")},
inverseJoinColumns={@JoinColumn(name="action_id")})
public Set<Action> getActions() {
return actions;
}

Action.java
@ManyToMany(
cascade={CascadeType.PERSIST},
mappedBy="actions",
targetEntity=Authority.class
)
public Set getAuthoritys() {
return authoritys;
}

The AUTHORITY_ACTION table look like this.
CREATE TABLE AUTHORITY_ACTION (
authority_id VARCHAR2(32),
action_id NUMBER,
FOREIGN KEY (authority_id) references AUTHORITY (id),
FOREIGN KEY (action_id) references ACTION (id)
);



When I'm in my taglib trying to get all actions related to the authority
authority.getActions(); I get the following error....

Hibernate: select actions0_.authority_id as authority1_0_, actions0_.elt as elt0_ from AUTHORITY_ACTION actions0_ where actions0_.authority_id=?
2006-08-28 17:50:26,696 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL Error: 904, SQLState: 42000>
2006-08-28 17:50:26,696 ERROR [org.hibernate.util.JDBCExceptionReporter] - <ORA-00904: "ACTIONS0_"."ELT": invalid identifier

2006-08-28 17:50:26,712 ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/presentation-0.1].[jsp]] - <Servlet.service() for servlet jsp threw exception>
org.hibernate.exception.SQLGrammarException: could not initialize a collection: [com.company.salestool.domain.Authority.actions#1]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1926)
at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)

Any help or pointers are welcome.

_________________
kmike


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.