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
|