-->
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: Positioned updates and deletes are not supported
PostPosted: Mon Sep 07, 2009 5:54 pm 
Newbie

Joined: Sat Jun 09, 2007 12:29 pm
Posts: 19
I'm using annotations and I'm getting this strange error, when triggering following function:

Code:
Session session = HibernateCoreUtil.getSession();
      
      String reportFormId = request.getParameter("id");
      
      if (reportFormId==null && !reportFormId.equals(""))
         throw new RuntimeException("Report form id is mandatory");
      
      ReportForm report = (ReportForm)session.load(
                        ReportForm.class,
                        Long.valueOf(reportFormId)
                        );
      String json = "{success:true, data:" + JSONHelper.getHelper().getJSONObject(report).toString() + "}";
      session.close();
      
      PrintWriter writer = response.getWriter();
      writer.write(json);
      writer.close();


The class looks like this:

Code:
@Entity
@Table(name="SysReportForm")
@javax.persistence.NamedQueries
({
   @NamedQuery(name="sys.allReportForms", query="select o from ReportForm o"),   
   @NamedQuery(name="sys.getReportFormById", query="select o from ReportForm o where o.id = :id"),
   @NamedQuery(name="sys.getReportFormByNameSymbol", query="select o from ReportForm o where o.nameSymbol = :nameSymbol"),
})
public class ReportForm {
   
   @Id
   @GeneratedValue
   private Long id;
   
   @Column(name = "nameSymbol", length=30, nullable=false, unique=true)
   private String nameSymbol;
   
   @Column(name = "description", length=30, nullable=false)
   private String description;
   
   @ManyToOne
    @JoinColumn(name="moduleId", nullable=false)
    private Module module;
   
   @ManyToMany(targetEntity=ReportCategory.class,cascade={CascadeType.PERSIST, CascadeType.MERGE})
   @JoinTable(name="SysReportFormReportCategory",joinColumns=@JoinColumn(name="reportFormId"),inverseJoinColumns=@JoinColumn(name="reportCategoryId"))
   private List<ReportCategory> categories = new ArrayList<ReportCategory>();



Why is this error happening I'm not updating anything?

Any help appreciated.

_________________
http://www.objectverse.com
http://www.alcyone.si
http://blog.alcyone.si


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.