Dear colleagues, 

I have Termnal and Firmware entities , with Terminal_Firmware table that 
defines many-to-many relationship. 
Terminal has a collection of bound Firmwares : 

@ManyToMany(cascade = {CascadeType.PERSIST})
  | @JoinTable(
  | name="Terminal_Firmware", 
  | [EMAIL PROTECTED](name="tId",  referencedColumnName="tId"),
  | [EMAIL PROTECTED](name="fId", referencedColumnName="Id")
  | )                   
  | 
  | public List<Firmware> getFirmwares()
  | {
  |     return firmwares;
  | }


Terminal_Firmware also contains integer column "position", which I want 
firmwares to be sorted by. 

Problem can be solved by adding a separate entity for Terminal_Firmware and 
making a query to all 3 tables, but I'd like to avoid that . 

@OrderBy annotation does not work for fields in mapping table. 

Do you know the way ? 
Many thanks in advance. 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115412#4115412

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115412
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to