-->
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.  [ 7 posts ] 
Author Message
 Post subject: Delete operation not cascading on OneToMany relationship
PostPosted: Sun Aug 05, 2007 1:08 pm 
Newbie

Joined: Wed Mar 02, 2005 10:52 am
Posts: 7
I am probably missing something here but here we go.

I have 2 classes, User and Authority, mapped using annotations. A User has a List of authorities(OneToMany relationship).

The thing is, when I remove a item from the list(say, using ListIterator) and issue session.update(user), the delete is not cascaded. It tries to null out the username field on the authorities table instead of deleting the record.

Here are the classes:

User.java
Code:
@Entity
@Table(name="users")
public class User {
   private String username;
   private String password;
   private String fullname;
   private Boolean enabled;
   private List<Authority> authorities = new ArrayList<Authority>();

   @Id
   @Column(length=50, name="username", nullable=false)
   public String getUsername() {
      return username;
   }

   public void setUsername(String username) {
      this.username = username;
   }

   @Column(length=64, name="password", nullable=false)
   public String getPassword() {
      return password;
   }

   public void setPassword(String password) {
      this.password = password;
   }

   @Column(length=100, name="fullname", nullable=false)
   public String getFullname() {
      return fullname;
   }

   public void setFullname(String fullname) {
      this.fullname = fullname;
   }

   public Boolean getEnabled() {
      return enabled;
   }

   @Column(name="enabled", nullable=false)
   public void setEnabled(Boolean enabled) {
      this.enabled = enabled;
   }

   @OneToMany(cascade = CascadeType.ALL,fetch = FetchType.EAGER)
   @JoinColumn(name="username")   
   @Cascade({org.hibernate.annotations.CascadeType.ALL})
   public List<Authority> getAuthorities() {
      return authorities;
   }

   public void setAuthorities(List<Authority> authorities) {
      this.authorities = authorities;
   }
}


Authority.java
Code:
@Entity
@IdClass(AuthorityPK.class)
@Table(name="authorities")
public class Authority {
   private String username;
   private String authority;

   
   @Id
   @Column(length=50, name="username", nullable=false)
   public String getUsername() {
      return username;
   }

   public void setUsername(String username) {
      this.username = username;
   }

   @Id
   @Column(length=50, name="authority", nullable=false)
   public String getAuthority() {
      return authority;
   }

   public void setAuthority(String authority) {
      this.authority = authority;
   }
   
   @Override
   public boolean equals(Object obj) {
      if (obj != null &&
            ((Authority)obj).getUsername().equals(this.getUsername()) &&
            ((Authority)obj).getAuthority().equals(this.getAuthority())) {
         return true;
      }
      return false;
   }
}



Other info:

Hibernate version: 3.2

Full stack trace of any exception that occurs(the first 3 lines are the last SQL commands issued by Hiberntae):
2007-08-05 13:28:13,255 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL Error: 0, SQLState: 01004>
2007-08-05 13:28:13,255 ERROR [org.hibernate.util.JDBCExceptionReporter] - <Data truncation: Column was set to data type implicit default; NULL supplied for NOT NULL column 'username' at row 1>
2007-08-05 13:28:13,260 ERROR [org.hibernate.event.def.AbstractFlushingEventListener] - <Could not synchronize database state with session>
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:237)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:144)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.springframework.orm.hibernate3.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:390)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:373)
at org.springframework.orm.hibernate3.HibernateTemplate.update(HibernateTemplate.java:654)
at org.springframework.orm.hibernate3.HibernateTemplate.update(HibernateTemplate.java:650)
at org.bugHunt.security.dao.UserDaoImpl.update(UserDaoImpl.java:53)
at org.bugHunt.security.service.UserServiceImpl.update(UserServiceImpl.java:37)
at org.bugHunt.security.web.controllers.ManageUserController.doEdit(ManageUserController.java:74)
at org.bugHunt.web.controllers.base.BaseSimpleManagerController.onSubmit(BaseSimpleManagerController.java:89)
at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:267)
at org.springframework.web.servlet.mvc.CancellableFormController.processFormSubmission(CancellableFormController.java:140)
at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:250)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:857)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:475)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:440)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:229)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:286)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.BatchUpdateException: Data truncation: Column was set to data type implicit default; NULL supplied for NOT NULL column 'username' at row 1
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:647)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:294)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)


Name and version of the database you are using: MySQL 5

The generated SQL (show_sql=true):
Hibernate: select user0_.username as username3_, user0_.password as password3_, user0_.fullname as fullname3_, user0_.enabled as enabled3_ from users user0_ where user0_.username='nana'
Hibernate: select authoritie0_.username as username1_, authoritie0_.authority as authority1_, authoritie0_.authority as authority4_0_, authoritie0_.username as username4_0_ from authorities authoritie0_ where authoritie0_.username=?
Hibernate: select user0_.username as username3_, user0_.password as password3_, user0_.fullname as fullname3_, user0_.enabled as enabled3_ from users user0_ where user0_.username='nana'
Hibernate: select authoritie0_.username as username1_, authoritie0_.authority as authority1_, authoritie0_.authority as authority4_0_, authoritie0_.username as username4_0_ from authorities authoritie0_ where authoritie0_.username=?
Hibernate: select authority_.authority, authority_.username from authorities authority_ where authority_.authority=? and authority_.username=?
Hibernate: update users set password=?, fullname=?, enabled=? where username=?
Hibernate: update authorities set username=null where username=? and authority=? and username=?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 05, 2007 1:26 pm 
Expert
Expert

Joined: Fri Jul 13, 2007 8:18 am
Posts: 370
Location: london
Try this:
Code:
@OneToMany(cascade = CascadeType.ALL,fetch = FetchType.EAGER)
@JoinColumn(name="username", nullable=false)   
@Cascade({org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
   public List<Authority> getAuthorities() {
      return authorities;
   }


btw - you should really override hashCode when you override equals.
http://java.sun.com/javase/6/docs/api/j ... ang.Object)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 05, 2007 1:46 pm 
Newbie

Joined: Wed Mar 02, 2005 10:52 am
Posts: 7
hey, thanks for the reply!

I just tried that, but the result was the same...


It is strange... instead of removing the records, it tries to nullout its key.

I even tried .clear() at the list but the result is still the same.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 05, 2007 1:54 pm 
Expert
Expert

Joined: Fri Jul 13, 2007 8:18 am
Posts: 370
Location: london
Are you sure this didn't work? I built a test case based on your annotation and saw the same behaviour of setting the column to null. Setting nullable=false on the join definitely fixed it.

btw - I'm using version 3.2.5ga


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 05, 2007 2:07 pm 
Newbie

Joined: Wed Mar 02, 2005 10:52 am
Posts: 7
Hey man, my bad. It did work. Thanks a lot.

I am getting now another strange behavior, but I'll study this deeper and try to fix. Otherwise I'll reply back.

Thanks again!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 06, 2007 8:45 am 
Newbie

Joined: Wed Mar 02, 2005 10:52 am
Posts: 7
Ok, after a whole evening on this, I could not make it work.

What I am trying to do now is update a User. This specific user object does not have any authority assigned to him (an empty list). So I add an authority to the list and issue an update.

IMO, the sql statement looks fine, but where did it take that 3 parameter from?

The classes with annotations are deppicted on the first post, the stack trace and generated SQL are as follows:

Full stack trace of any exception that occurs:
2007-08-06 08:23:17,216 INFO [org.hibernate.type.StringType] - <could not bind value 'teste' to parameter: 3; Parameter index out of bounds. 3 is not between valid values of 1 and 2>
2007-08-06 08:23:17,222 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL Error: 0, SQLState: S1009>
2007-08-06 08:23:17,222 ERROR [org.hibernate.util.JDBCExceptionReporter] - <Parameter index out of bounds. 3 is not between valid values of 1 and 2>
2007-08-06 08:23:17,227 ERROR [org.hibernate.event.def.AbstractFlushingEventListener] - <Could not synchronize database state with session>
org.hibernate.exception.GenericJDBCException: could not insert: [org.bugHunt.security.model.Authority]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2267)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.springframework.orm.hibernate3.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:390)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:373)
at org.springframework.orm.hibernate3.HibernateTemplate.update(HibernateTemplate.java:654)
at org.springframework.orm.hibernate3.HibernateTemplate.update(HibernateTemplate.java:650)
at org.bugHunt.security.dao.UserDaoImpl.update(UserDaoImpl.java:53)
at org.bugHunt.security.service.UserServiceImpl.update(UserServiceImpl.java:37)
at org.bugHunt.security.web.controllers.ManageUserController.doEdit(ManageUserController.java:70)
at org.bugHunt.web.controllers.base.BaseSimpleManagerController.onSubmit(BaseSimpleManagerController.java:89)
at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:267)
at org.springframework.web.servlet.mvc.CancellableFormController.processFormSubmission(CancellableFormController.java:140)
at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:250)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:857)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:475)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:440)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:229)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:286)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: Parameter index out of bounds. 3 is not between valid values of 1 and 2
at com.mysql.jdbc.ServerPreparedStatement.getBinding(ServerPreparedStatement.java:751)
at com.mysql.jdbc.ServerPreparedStatement.setString(ServerPreparedStatement.java:1803)
at org.apache.commons.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:131)
at org.hibernate.type.StringType.set(StringType.java:26)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:136)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:116)
at org.hibernate.type.ComponentType.nullSafeSet(ComponentType.java:284)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2008)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2243)

The generated SQL (show_sql=true):
Hibernate: select user0_.username as username3_, user0_.password as password3_, user0_.fullname as fullname3_, user0_.enabled as enabled3_ from users user0_
Hibernate: select authoritie0_.username as username1_, authoritie0_.authority as authority1_, authoritie0_.authority as authority4_0_, authoritie0_.username as username4_0_ from authorities authoritie0_ where authoritie0_.username=?
Hibernate: select authoritie0_.username as username1_, authoritie0_.authority as authority1_, authoritie0_.authority as authority4_0_, authoritie0_.username as username4_0_ from authorities authoritie0_ where authoritie0_.username=?
Hibernate: select user0_.username as username3_, user0_.password as password3_, user0_.fullname as fullname3_, user0_.enabled as enabled3_ from users user0_ where user0_.username='teste'
Hibernate: select authoritie0_.username as username1_, authoritie0_.authority as authority1_, authoritie0_.authority as authority4_0_, authoritie0_.username as username4_0_ from authorities authoritie0_ where authoritie0_.username=?
Hibernate: select user0_.username as username3_, user0_.password as password3_, user0_.fullname as fullname3_, user0_.enabled as enabled3_ from users user0_ where user0_.username='teste'
Hibernate: select authoritie0_.username as username1_, authoritie0_.authority as authority1_, authoritie0_.authority as authority4_0_, authoritie0_.username as username4_0_ from authorities authoritie0_ where authoritie0_.username=?
Hibernate: select authority_.authority, authority_.username from authorities authority_ where authority_.authority=? and authority_.username=?
Hibernate: insert into authorities (authority, username) values (?, ?)

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 06, 2007 9:25 am 
Expert
Expert

Joined: Fri Jul 13, 2007 8:18 am
Posts: 370
Location: london
Your relationship mapping is wrong. You declare getAuthorities in User as OneToMany but specify the JoinColumn to be the primary key of the Authorities table. I'm guessing that username as the Authorities primary key is not what you want, otherwise you could only have 1 Authority per user (pk unique constraint). Try a surrogate primary key for Authority.


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

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.