0 Replies Latest reply on Jun 29, 2010 5:19 AM by ashokmignite

    how to reinsert an managed entity bean object to the same schema

    ashokmignite
      hi i am new to SEAM framework pls help me in this.

      i have a schema that consist of
      id(primary)
      name
      description""
      ref_id(foreign key)

      here i am trying to make a new entry in the table which is already been used for another reference column,


      here are the code 



      public class DimensionHome extends EntityHome<Dimension> {

              private static final long serialVersionUID = -6433901846856984856L;
             
              @In(create = true)
              KeyProcessAreaHome keyProcessAreaHome;

              public void setDimensionDimensionNumber(Integer id) {
                      setId(id);
                      System.out.println("ID:--->"+id);
              }

              public Integer getDimensionDimensionNumber() {
                      return (Integer) getId();
              }
             
             
             
             

              @Override
              protected Dimension createInstance() {
                      Dimension dimension = new Dimension();
                      return dimension;
              }

              public void load() {
                      System.out.println("load executed\nis defined" + isIdDefined());
                      if (isIdDefined()) {
                           
                              wire();
                      }
              }

              public void wire() {
                      getInstance();
                      System.out.println("wire: getInstance"+getInstance() );
                      KeyProcessArea keyProcessArea = keyProcessAreaHome.getDefinedInstance();
                      if (keyProcessArea != null) {
                              getInstance().setKeyProcessArea(keyProcessArea);
                      }
              }

              public boolean isWired() {
                      if (getInstance().getKeyProcessArea() == null)
                              return false;
                      return true;
              }

              public Dimension getDefinedInstance() {
                      return isIdDefined() ? getInstance() : null;
              }

              public List<Parameter> getParameters() {
                      return getInstance() == null ? null : new ArrayList<Parameter>(
                                      getInstance().getParameterses());
              }
             

      }


      ``