[hibernate-issues] [Hibernate-JIRA] Resolved: (ANN-531) EntityMode.DOM4J does not deserialize collection entities

Emmanuel Bernard (JIRA) noreply at atlassian.com
Fri Mar 9 16:29:15 EST 2007


     [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-531?page=all ]
     
Emmanuel Bernard resolved ANN-531:
----------------------------------

    Resolution: Fixed

no user feedback, but I opened ANN-572 for the general @Node annotation

> EntityMode.DOM4J does not deserialize collection entities
> ---------------------------------------------------------
>
>          Key: ANN-531
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-531
>      Project: Hibernate Annotations
>         Type: Bug

>   Components: binder
>     Versions: 3.2.1
>  Environment: PATCH ANN-517 APPLIED (see http://opensource.atlassian.com/projects/hibernate/browse/ANN-517), revision 11026.
>     Reporter: Laurent Perez
>      Fix For: 3.3.0.ga

>
>
> The XML deserialization of an entity does not deserializes its child properties but only its id, following sample :
> Foobean are children of a Screen :
> @Entity
> @Table (name="foobean")
> public class Foobean implements java.io.Serializable {
> 	private String name;
> 	private String age;
> 	private Screen screen;
> 	@Id
> 	@Column(name="name")
> 	public String getName() {
> 		return name;
> 	}
> 	public void setName(String name) {
> 		this.name = name;
> 	}
> 	@ManyToOne
> 	public Screen getScreen() {
> 		return this.screen;
> 	}
> 	public void setScreen(Screen screen) {
> 		this.screen = screen;
> 	}
> 	@Column(name="age")
> 	public String getAge() {
> 		return age;
> 	}
> 	public void setAge(String age) {
> 		this.age = age;
> 	}
> }
> Relevant parent  Screen annotations :
>         private Set<Foobean> fooBeans = new HashSet<Foobean>();
> 	@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)
> 	public Set<Foobean> getFoobeans(){
> 		return this.fooBeans;
> 	}
> 	public void setFoobeans(Set<Foobean> fooBeans) {
> 		this.fooBeans = fooBeans;
> 	}
> Association :
> 		Foobean foobean = new Foobean();
> 		foobean.setName("foo");
> 		foobean.setAge("age");
> 		foobean.setScreen(screen);
> 		screen.getFoobeans().add(foobean);
> Generated XML (the age property of Foobean is missing, i.e there is no <name>foo</name><age>age</age>) :
> <Screen>
> <id>1</id>
> <foobeans>
> <Foobean>foo</Foobean>
> </foobeans>
> </Screen>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list