You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Andreas Pursian <dg...@gmx.net> on 2010/07/09 12:26:55 UTC

T5: Beaneditor Annotations get ignored with lazy Associations

Dear List members,

I experienced a strange problem while combining Beaneditor annotations
with objects fetched through a lazy OneToOne association.
Beaneditor annotations on setter methods like
(@DataType(value="longtext") or @NonVisual) gets ignored when the
OneToOne association is lazy fetched (fetch=FetchType.LAZY). Annotations
on getter methods (like @Validate("required")) are working probably.
Eager fetching the association solves this issue but is unfortunately no
option due to a complex data scheme.

The data scheme looks like this:

MainClassA  --> DataClassB
	    --> DataClassC
	    --> DataClassD
	    etc.

MainClassA has a number of OneToOne associations. Each of these
associated data classes are simple POJOs which will get edited/displayed
by beaneditor-/display components.

Here is an example of our OneToOne association:

@OneToOne(cascade={CascadeType.PERSIST,
  		  CascadeType.MERGE, 	
		  CascadeType.REMOVE},
	  optional=false)
@Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE})
@JoinColumn(name="classB_fk", unique=true )
public DataClassB getDataClassBData() {

	//do something	
}

If I switched to lazy fetching like this

@OneToOne(cascade={CascadeType.PERSIST,
  		  CascadeType.MERGE, 	
		  CascadeType.REMOVE},
	  optional=false,
	  fetch=FetchType.LAZY)

the problem occur.

I do use T5.1.0.5 and Hibernate 3.3.1GA

Thanks in advance ....

Cheers
Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org