title: How to do hibernate spatial delete?
body: <p>I want to delete my database datas.</p>
  
  <p>This is AJAX code taken from value from the TextBox :</p>
  
  <pre><code> function deleteVector()
  {
      var value = $('#hs').val();
      console.log(value);
      $.ajax({
          type: "GET",
          url: "/deleteGeoJson",
          data: {id: value},
          contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
          success: function (data) {
              var parser = new OpenLayers.Format.GeoJSON();
              var feature = parser.read(data.data);
          }
      });
  }
  </code></pre>
  
  <p>this is my button code :
   <li>
      Delete
            
        </li></p>
  
  <p>and this is my controller ( get method )</p>
  
  <pre><code> SavegeojsonManager add = new SavegeojsonManager();
  
   @RequestMapping(value = "/deleteGeoJson", method = RequestMethod.GET)
  @ResponseBody
  public GeoJSON deleteGeoJson( final HttpServletRequest request,@RequestParam("id") final int vectorId) {
      return add.delete(vectorId);
  }
  </code></pre>
  
  <p>this is SavegeojsonManager class codee :</p>
  
  <pre><code> public GeoJSON delete(int id) {
  
      GeoJSON geoJson = new GeoJSON();
      try{
          EntityManager em = HibernateSpatialJPA.createEntityManager();
          em.getTransaction().begin();
          //How can I continue ?
         //If there's one thing if it is connected to the data you delete it
        //so cascade ??
  
      }
      catch (Exception ex)
      {
          ex.printStackTrace();
      }
      return geoJson;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and this is GeoJSON Class :</p>
  
  <pre><code>private int id;
   public int getId() { return id; }
  public void setId(int id) {  this.id = id; }
  </code></pre>