openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fay Wang <fyw...@yahoo.com>
Subject Re: Exception in SQLBuffer.java on OpenJPA 1.3.0-SNAPSHOT
Date Fri, 03 Oct 2008 15:40:02 GMT
The class TblTrkdet is also missing...


--- On Fri, 10/3/08, Fay Wang <fyw300@yahoo.com> wrote:

> From: Fay Wang <fyw300@yahoo.com>
> Subject: Re: Exception in SQLBuffer.java on OpenJPA 1.3.0-SNAPSHOT
> To: users@openjpa.apache.org
> Date: Friday, October 3, 2008, 8:34 AM
> Hi Enrico,
>    Could you also provide class TblItmtyp? Thanks!
> 
> 
> --- On Fri, 10/3/08, egoosen
> <egoosen2@metropolitan.co.za> wrote:
> 
> > From: egoosen <egoosen2@metropolitan.co.za>
> > Subject: Exception in SQLBuffer.java on OpenJPA
> 1.3.0-SNAPSHOT
> > To: users@openjpa.apache.org
> > Date: Friday, October 3, 2008, 6:46 AM
> > Hi,
> > 
> > I'm getting the following exception when this code
> > runs:
> > public TblItmdes getTrackingItem(String itmCde){
> > 		TblItmdes tblItmdes =
> > getTblItmdesDAO().findTblItmdesByItmCde(itmCde);
> > 		tblItmdes.getTblTrklnks(); //<-- lazy load throws
> > exception
> > 		return tblItmdes;
> > 	}
> > 
> > PS. It works fine in 1.1.0.
> > 
> > Caused by: java.lang.IndexOutOfBoundsException: Index:
> 1,
> > Size: 1
> > 	at java.util.ArrayList.RangeCheck(ArrayList.java:546)
> > 	at java.util.ArrayList.get(ArrayList.java:321)
> > 	at
> >
> org.apache.openjpa.jdbc.sql.SQLBuffer.setParameters(SQLBuffer.java:629)
> > 	at
> >
> org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:529)
> > 	at
> >
> org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:485)
> > 	at
> >
> org.apache.openjpa.jdbc.sql.SelectImpl.prepareStatement(SelectImpl.java:463)
> > 	at
> >
> org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:379)
> > 	at
> >
> org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:339)
> > 	at
> >
> org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:420)
> > 	at
> >
> org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:230)
> > 	at
> >
> org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:220)
> > 	at
> >
> org.apache.openjpa.jdbc.meta.strats.StoreCollectionFieldStrategy.load(StoreCollectionFieldStrategy.java:603)
> > 	at
> >
> org.apache.openjpa.jdbc.meta.FieldMapping.load(FieldMapping.java:822)
> > 	at
> >
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:626)
> > 	at
> >
> org.apache.openjpa.kernel.DelegatingStoreManager.load(DelegatingStoreManager.java:116)
> > 	at
> >
> org.apache.openjpa.kernel.ROPStoreManager.load(ROPStoreManager.java:78)
> > 	at
> >
> org.apache.openjpa.kernel.StateManagerImpl.loadFields(StateManagerImpl.java:2920)
> > 	at
> >
> org.apache.openjpa.kernel.StateManagerImpl.loadField(StateManagerImpl.java:2998)
> > 	at
> >
> org.apache.openjpa.kernel.StateManagerImpl.beforeAccessField(StateManagerImpl.java:1492)
> > 	at
> >
> org.apache.openjpa.kernel.StateManagerImpl.accessingField(StateManagerImpl.java:1477)
> > 	at
> >
> za.co.metcapri.model.ebstatus.TblItmdes.pcGettblTrklnks(TblItmdes.java)
> > 	at
> >
> za.co.metcapri.model.ebstatus.TblItmdes.getTblTrklnks(TblItmdes.java:77)
> > 	at
> >
> za.co.metcapri.status.business.AdminManagerBean.getTrackingItem(AdminManagerBean.java:84)
> > 	at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)
> > 	at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > 	at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > 	at java.lang.reflect.Method.invoke(Method.java:585)
> > 	at
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:299)
> > 	at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172)
> > 	at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
> > 	at
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
> > 	at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
> > 	at
> >
> org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
> > 	at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
> > 	at
> >
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
> > 	at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
> > 	at
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
> > 	at $Proxy41.getTrackingItem(Unknown Source)
> > 	at
> >
> za.co.metcapri.status.server.services.AdminServiceBean.getTrackingItemLinks(AdminServiceBean.java:61)
> > 	at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)
> > 	at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > 	at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > 	at java.lang.reflect.Method.invoke(Method.java:585)
> > 	at
> >
> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:528)
> > 	... 16 more
> > 
> > public class TblItmdes extends BaseEntity {
> > 
> > //	Mapped Fields
> > 
> >
> @TableGenerator(name="tblItmdesGenerator",schema="EBSTATUS",table="TBL_KEYGEN",pkColumnName="PRIMARY_KEY_COLUMN"
> > 	
> >
> ,valueColumnName="LAST_USED_ID",pkColumnValue="TBL_ITMDES_ID",allocationSize=1)
> > 		@Id
> > 	
> >
> @GeneratedValue(strategy=GenerationType.TABLE,generator="tblItmdesGenerator")
> > 		@Column(name = "ITMDES_ID",nullable=false)
> > 		private Integer itmdesId;    
> > 
> > 	@Basic
> > 	@Column(name = "DPLODR_NBR",nullable=true) 
> > 	private Integer dplodrNbr;
> > 
> > 	@Basic
> > 	@Column(name = "ITM_CDE",nullable=true) 
> > 	private String itmCde;
> > 
> > 	@Basic
> > 	@Column(name = "ITM_DES",nullable=true) 
> > 	private String itmDes;
> > 
> > 
> > //	Mapped Relationships
> > 	@OneToMany(mappedBy="tblItmdes",fetch =
> > FetchType.LAZY,cascade = {
> > CascadeType.PERSIST,CascadeType.MERGE })
> > 	private Collection<TblTrklnk> tblTrklnks = new
> > ArrayList<TblTrklnk>();
> > 	@OneToMany(mappedBy="tblItmdes",fetch =
> > FetchType.LAZY,cascade = {
> > CascadeType.PERSIST,CascadeType.MERGE })
> > 	private Collection<TblTrkdet> tblTrkdets = new
> > ArrayList<TblTrkdet>();
> > 	public Integer getItmdesId() {
> > 		return getInteger(itmdesId);
> > 	}
> > 	public void setItmdesId(Integer itmdesId) {
> > 		this.itmdesId = itmdesId;
> > 	}
> > 
> > 	public Integer getDplodrNbr() {
> > 		return getInteger(dplodrNbr);
> > 	}
> > 	public void setDplodrNbr(Integer dplodrNbr) {
> > 		this.dplodrNbr = dplodrNbr;
> > 	}
> > 
> > 	public String getItmCde() {
> > 		return getString(itmCde);
> > 	}
> > 	public void setItmCde(String itmCde) {
> > 		this.itmCde = itmCde;
> > 	}
> > 
> > 	public String getItmDes() {
> > 		return getString(itmDes);
> > 	}
> > 	public void setItmDes(String itmDes) {
> > 		this.itmDes = itmDes;
> > 	}
> > 	public Collection<TblTrklnk> getTblTrklnks() {
> > 		if (tblTrklnks == null) {
> > 			tblTrklnks = new ArrayList<TblTrklnk>();
> > 		}
> > 		return tblTrklnks;
> > 	}
> > 	public void setTblTrklnks(Collection<TblTrklnk>
> > tblTrklnks) {
> > 		this.tblTrklnks = tblTrklnks;
> > 	}
> > 	public void addTblTrklnk(TblTrklnk tblTrklnk) {
> > 		tblTrklnk.setTblItmdes(this);
> > 		getTblTrklnks().add(tblTrklnk);
> > 	}
> > 	public void removeTblTrklnk(TblTrklnk tblTrklnk) {
> > 		tblTrklnk.setTblItmdes(null);
> > 		getTblTrklnks().remove(tblTrklnk);
> > 	}
> > 	public Collection<TblTrkdet> getTblTrkdets() {
> > 		if (tblTrkdets == null) {
> > 			tblTrkdets = new ArrayList<TblTrkdet>();
> > 		}
> > 		return tblTrkdets;
> > 	}
> > 	public void setTblTrkdets(Collection<TblTrkdet>
> > tblTrkdets) {
> > 		this.tblTrkdets = tblTrkdets;
> > 	}
> > 	public void addTblTrkdet(TblTrkdet tblTrkdet) {
> > 		tblTrkdet.setTblItmdes(this);
> > 		getTblTrkdets().add(tblTrkdet);
> > 	}
> > 	public void removeTblTrkdet(TblTrkdet tblTrkdet) {
> > 		tblTrkdet.setTblItmdes(null);
> > 		getTblTrkdets().remove(tblTrkdet);
> > 	}
> > 	protected void synchParentRelationships(){
> > 		getItmdesId();
> > 
> > 	}
> > 	protected void synchChildRelationships(){
> > 		syncCollection(getTblTrklnks());
> > 		syncCollection(getTblTrkdets());
> > 	}
> > }
> > 
> > public class TblTrklnk extends BaseEntity {
> > 
> > //	Mapped Fields
> > 
> >
> @TableGenerator(name="tblTrklnkGenerator",schema="EBSTATUS",table="TBL_KEYGEN",pkColumnName="PRIMARY_KEY_COLUMN"
> > 	
> >
> ,valueColumnName="LAST_USED_ID",pkColumnValue="TBL_TRKLNK_ID",allocationSize=1)
> > 	@Id
> > 
> >
> @GeneratedValue(strategy=GenerationType.TABLE,generator="tblTrklnkGenerator")
> > 	@Column(name = "TRKLNK_ID",nullable=false)
> > 	private Integer trklnkId;    
> > 
> > 	@Basic
> > 	@Column(name = "ITMTYP_CDE",nullable=true) 
> > 	private String itmtypCde;
> > 
> > 	@Basic
> > 	@Column(name = "ITM_CDE",nullable=true) 
> > 	private String itmCde;
> > 
> > 
> > //	Mapped Relationships
> > 	@ManyToOne(fetch = FetchType.EAGER,cascade = {
> > CascadeType.PERSIST,CascadeType.MERGE })
> > 	@JoinColumns({@JoinColumn(name =
> >
> "ITMTYP_CDE",referencedColumnName="ITMTYP_CDE")})
> >    
> > 	@ForeignKey
> > 	private TblItmtyp tblItmtyp;   
> > 	@ManyToOne(fetch = FetchType.LAZY,cascade = {
> > CascadeType.PERSIST,CascadeType.MERGE })
> > 	@JoinColumns({@JoinColumn(name =
> >
> "ITM_CDE",referencedColumnName="ITM_CDE")})
> >    
> > 	@ForeignKey
> > 	private TblItmdes tblItmdes;   
> > 	public Integer getTrklnkId() {
> > 		return getInteger(trklnkId);
> > 	}
> > 	public void setTrklnkId(Integer trklnkId) {
> > 		this.trklnkId = trklnkId;
> > 	}
> > 
> > 	public String getItmtypCde() {
> > 		return getString(itmtypCde);
> > 	}
> > 	public void setItmtypCde(String itmtypCde) {
> > 		this.itmtypCde = itmtypCde;
> > 	}
> > 
> > 	public String getItmCde() {
> > 		return getString(itmCde);
> > 	}
> > 	public void setItmCde(String itmCde) {
> > 		this.itmCde = itmCde;
> > 	}
> > 	public TblItmtyp getTblItmtyp() {
> > 		return tblItmtyp;
> > 	}
> > 	public void setTblItmtyp(TblItmtyp tblItmtyp) {
> > 		this.tblItmtyp = tblItmtyp;
> >
> 		if(tblItmtyp!=null&&tblItmtyp.getItmtypCde()!=null){
> > 			setItmtypCde(tblItmtyp.getItmtypCde());
> > 		}	
> > 	}
> > 	public TblItmdes getTblItmdes() {
> > 		return tblItmdes;
> > 	}
> > 	public void setTblItmdes(TblItmdes tblItmdes) {
> > 		this.tblItmdes = tblItmdes;
> >
> 		if(tblItmdes!=null&&tblItmdes.getItmCde()!=null){
> > 			setItmCde(tblItmdes.getItmCde());
> > 		}	
> > 	}
> > 	protected void synchParentRelationships(){
> > 		getTrklnkId();
> > 
> > 		if (needsToSynch(getTblItmtyp())) {
> > 			setTblItmtyp(getTblItmtyp());
> > 		}
> > 		if (needsToSynch(getTblItmdes())) {
> > 			setTblItmdes(getTblItmdes());
> > 		}
> > 	}
> > 	protected void synchChildRelationships(){
> > 	}
> > }
> > -- 
> > View this message in context:
> >
> http://n2.nabble.com/Exception-in-SQLBuffer.java-on-OpenJPA-1.3.0-SNAPSHOT-tp1141997p1141997.html
> > Sent from the OpenJPA Users mailing list archive at
> > Nabble.com.


      

Mime
View raw message