Cezar,
I'm using -javasource 1.5 the problem is that this generate getter List<YYY> but does not setter List<YYY> and i need the set, because i am using xmlObjects in Hibernate mapping , and in core hibernate they generate a persistSet that is puting in SET mapping.
do you know how i can do schemagen generate setters ? or why schemagen does not generate setters ?
To work around this im putting this code in generated class:
public void setVusuarioList( java.util.Set<org.apache.xmlbeans.XmlObject> set){
org.apache.xmlbeans.XmlObject[] array = (org.apache.xmlbeans.XmlObject[])set.toArray(new org.apache.xmlbeans.XmlObject[set.size()]);
setVusuarioArray(array);
}
Making it hibernate work fine with XMLBeans.
My appologies for my poor english, to help me I attached my source if can help to undestand what i can talk.
Thanks
Gustavo Aquino
On 9/12/06, Cezar Andrei <[EMAIL PROTECTED]> wrote:Try compiling your schemas using scomp's –javasource 1.5 option, and in addition to the getXXXArray methods it will generate typed list getters List<YYY> getXXXList() and List<ZZZ> xgetXXXList().
Cezar
From: Gustavo Aquino [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 11, 2006 9:05 AM
To: [email protected]
Subject: Xmlbeans function setXXXList(Set or List)
Hi,
I'm using xmlbeans a long time. now i need to set a java.util.Set in XmlObject, we have getXXXList() to transform a arrayObjects in a List, why we dont have a setXXXList(Set or List) to transform list in arrayObjects ? Im work around to implement this in my build code, but i think that this is very util for more people.
Some one know why XMLBeans dont have this function in XMLObjects ? and if is really cool how i can suggest that this function is implemented in schemagen ?
Thanks.
Gustavo Aquino>>Register now for BEA World 2006 --- See http://www.bea.com/beaworld<<
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
/*
* XML Type: vPerfil
* Namespace:
* Java type: br.com.bvsistemas.servicoteste.integracao.VPerfil
*
* Automatically generated - do not modify.
*/
package br.com.bvsistemas.servicoteste.integracao.impl;
/**
* An XML vPerfil(@).
*
* This is a complex type.
*/
public class VPerfilImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements br.com.bvsistemas.servicoteste.integracao.VPerfil
{
public VPerfilImpl(org.apache.xmlbeans.SchemaType sType)
{
super(sType);
}
private static final javax.xml.namespace.QName DTCADASTRO$0 =
new javax.xml.namespace.QName("", "dtCadastro");
private static final javax.xml.namespace.QName IDPERFIL$2 =
new javax.xml.namespace.QName("", "idPerfil");
private static final javax.xml.namespace.QName NMPERFIL$4 =
new javax.xml.namespace.QName("", "nmPerfil");
private static final javax.xml.namespace.QName VALOR$6 =
new javax.xml.namespace.QName("", "valor");
private static final javax.xml.namespace.QName VUSUARIO$8 =
new javax.xml.namespace.QName("", "vusuario");
/**
* Gets the "dtCadastro" element
*/
public java.util.Calendar getDtCadastro()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DTCADASTRO$0, 0);
if (target == null)
{
return null;
}
return target.getCalendarValue();
}
}
/**
* Gets (as xml) the "dtCadastro" element
*/
public org.apache.xmlbeans.XmlDateTime xgetDtCadastro()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlDateTime target = null;
target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(DTCADASTRO$0, 0);
return target;
}
}
/**
* True if has "dtCadastro" element
*/
public boolean isSetDtCadastro()
{
synchronized (monitor())
{
check_orphaned();
return get_store().count_elements(DTCADASTRO$0) != 0;
}
}
/**
* Sets the "dtCadastro" element
*/
public void setDtCadastro(java.util.Calendar dtCadastro)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DTCADASTRO$0, 0);
if (target == null)
{
target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(DTCADASTRO$0);
}
target.setCalendarValue(dtCadastro);
}
}
/**
* Sets (as xml) the "dtCadastro" element
*/
public void xsetDtCadastro(org.apache.xmlbeans.XmlDateTime dtCadastro)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlDateTime target = null;
target = (org.apache.xmlbeans.XmlDateTime)get_store().find_element_user(DTCADASTRO$0, 0);
if (target == null)
{
target = (org.apache.xmlbeans.XmlDateTime)get_store().add_element_user(DTCADASTRO$0);
}
target.set(dtCadastro);
}
}
/**
* Unsets the "dtCadastro" element
*/
public void unsetDtCadastro()
{
synchronized (monitor())
{
check_orphaned();
get_store().remove_element(DTCADASTRO$0, 0);
}
}
/**
* Gets the "idPerfil" element
*/
public int getIdPerfil()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(IDPERFIL$2, 0);
if (target == null)
{
return 0;
}
return target.getIntValue();
}
}
/**
* Gets (as xml) the "idPerfil" element
*/
public org.apache.xmlbeans.XmlInt xgetIdPerfil()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlInt target = null;
target = (org.apache.xmlbeans.XmlInt)get_store().find_element_user(IDPERFIL$2, 0);
return target;
}
}
/**
* True if has "idPerfil" element
*/
public boolean isSetIdPerfil()
{
synchronized (monitor())
{
check_orphaned();
return get_store().count_elements(IDPERFIL$2) != 0;
}
}
/**
* Sets the "idPerfil" element
*/
public void setIdPerfil(int idPerfil)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(IDPERFIL$2, 0);
if (target == null)
{
target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(IDPERFIL$2);
}
target.setIntValue(idPerfil);
}
}
/**
* Sets (as xml) the "idPerfil" element
*/
public void xsetIdPerfil(org.apache.xmlbeans.XmlInt idPerfil)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlInt target = null;
target = (org.apache.xmlbeans.XmlInt)get_store().find_element_user(IDPERFIL$2, 0);
if (target == null)
{
target = (org.apache.xmlbeans.XmlInt)get_store().add_element_user(IDPERFIL$2);
}
target.set(idPerfil);
}
}
/**
* Unsets the "idPerfil" element
*/
public void unsetIdPerfil()
{
synchronized (monitor())
{
check_orphaned();
get_store().remove_element(IDPERFIL$2, 0);
}
}
/**
* Gets the "nmPerfil" element
*/
public java.lang.String getNmPerfil()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(NMPERFIL$4, 0);
if (target == null)
{
return null;
}
return target.getStringValue();
}
}
/**
* Gets (as xml) the "nmPerfil" element
*/
public org.apache.xmlbeans.XmlString xgetNmPerfil()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlString target = null;
target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(NMPERFIL$4, 0);
return target;
}
}
/**
* True if has "nmPerfil" element
*/
public boolean isSetNmPerfil()
{
synchronized (monitor())
{
check_orphaned();
return get_store().count_elements(NMPERFIL$4) != 0;
}
}
/**
* Sets the "nmPerfil" element
*/
public void setNmPerfil(java.lang.String nmPerfil)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(NMPERFIL$4, 0);
if (target == null)
{
target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(NMPERFIL$4);
}
target.setStringValue(nmPerfil);
}
}
/**
* Sets (as xml) the "nmPerfil" element
*/
public void xsetNmPerfil(org.apache.xmlbeans.XmlString nmPerfil)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlString target = null;
target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(NMPERFIL$4, 0);
if (target == null)
{
target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(NMPERFIL$4);
}
target.set(nmPerfil);
}
}
/**
* Unsets the "nmPerfil" element
*/
public void unsetNmPerfil()
{
synchronized (monitor())
{
check_orphaned();
get_store().remove_element(NMPERFIL$4, 0);
}
}
/**
* Gets the "valor" element
*/
public double getValor()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(VALOR$6, 0);
if (target == null)
{
return 0.0;
}
return target.getDoubleValue();
}
}
/**
* Gets (as xml) the "valor" element
*/
public org.apache.xmlbeans.XmlDouble xgetValor()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlDouble target = null;
target = (org.apache.xmlbeans.XmlDouble)get_store().find_element_user(VALOR$6, 0);
return target;
}
}
/**
* True if has "valor" element
*/
public boolean isSetValor()
{
synchronized (monitor())
{
check_orphaned();
return get_store().count_elements(VALOR$6) != 0;
}
}
/**
* Sets the "valor" element
*/
public void setValor(double valor)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(VALOR$6, 0);
if (target == null)
{
target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(VALOR$6);
}
target.setDoubleValue(valor);
}
}
/**
* Sets (as xml) the "valor" element
*/
public void xsetValor(org.apache.xmlbeans.XmlDouble valor)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlDouble target = null;
target = (org.apache.xmlbeans.XmlDouble)get_store().find_element_user(VALOR$6, 0);
if (target == null)
{
target = (org.apache.xmlbeans.XmlDouble)get_store().add_element_user(VALOR$6);
}
target.set(valor);
}
}
/**
* Unsets the "valor" element
*/
public void unsetValor()
{
synchronized (monitor())
{
check_orphaned();
get_store().remove_element(VALOR$6, 0);
}
}
public void setVusuarioList(java.util.Set<org.apache.xmlbeans.XmlObject> set){
org.apache.xmlbeans.XmlObject[] array = (org.apache.xmlbeans.XmlObject[])set.toArray(new org.apache.xmlbeans.XmlObject[set.size()]);
setVusuarioArray(array);
}
/**
* Gets a List of "vusuario" elements
*/
public java.util.List<org.apache.xmlbeans.XmlObject> getVusuarioList()
{
final class VusuarioList extends java.util.AbstractList<org.apache.xmlbeans.XmlObject>
{
public org.apache.xmlbeans.XmlObject get(int i)
{ return VPerfilImpl.this.getVusuarioArray(i); }
public org.apache.xmlbeans.XmlObject set(int i, org.apache.xmlbeans.XmlObject o)
{
org.apache.xmlbeans.XmlObject old = VPerfilImpl.this.getVusuarioArray(i);
VPerfilImpl.this.setVusuarioArray(i, o);
return old;
}
public void add(int i, org.apache.xmlbeans.XmlObject o)
{ VPerfilImpl.this.insertNewVusuario(i).set(o); }
public org.apache.xmlbeans.XmlObject remove(int i)
{
org.apache.xmlbeans.XmlObject old = VPerfilImpl.this.getVusuarioArray(i);
VPerfilImpl.this.removeVusuario(i);
return old;
}
public int size()
{ return VPerfilImpl.this.sizeOfVusuarioArray(); }
}
synchronized (monitor())
{
check_orphaned();
return new VusuarioList();
}
}
/**
* Gets array of all "vusuario" elements
*/
public org.apache.xmlbeans.XmlObject[] getVusuarioArray()
{
synchronized (monitor())
{
check_orphaned();
java.util.List targetList = new java.util.ArrayList();
get_store().find_all_element_users(VUSUARIO$8, targetList);
org.apache.xmlbeans.XmlObject[] result = new org.apache.xmlbeans.XmlObject[targetList.size()];
targetList.toArray(result);
return result;
}
}
/**
* Gets ith "vusuario" element
*/
public org.apache.xmlbeans.XmlObject getVusuarioArray(int i)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlObject target = null;
target = (org.apache.xmlbeans.XmlObject)get_store().find_element_user(VUSUARIO$8, i);
if (target == null)
{
throw new IndexOutOfBoundsException();
}
return target;
}
}
/**
* Tests for nil ith "vusuario" element
*/
public boolean isNilVusuarioArray(int i)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlObject target = null;
target = (org.apache.xmlbeans.XmlObject)get_store().find_element_user(VUSUARIO$8, i);
if (target == null)
{
throw new IndexOutOfBoundsException();
}
return target.isNil();
}
}
/**
* Returns number of "vusuario" element
*/
public int sizeOfVusuarioArray()
{
synchronized (monitor())
{
check_orphaned();
return get_store().count_elements(VUSUARIO$8);
}
}
/**
* Sets array of all "vusuario" element
*/
public void setVusuarioArray(org.apache.xmlbeans.XmlObject[] vusuarioArray)
{
synchronized (monitor())
{
check_orphaned();
arraySetterHelper(vusuarioArray, VUSUARIO$8);
}
}
/**
* Sets ith "vusuario" element
*/
public void setVusuarioArray(int i, org.apache.xmlbeans.XmlObject vusuario)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlObject target = null;
target = (org.apache.xmlbeans.XmlObject)get_store().find_element_user(VUSUARIO$8, i);
if (target == null)
{
throw new IndexOutOfBoundsException();
}
target.set(vusuario);
}
}
/**
* Nils the ith "vusuario" element
*/
public void setNilVusuarioArray(int i)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlObject target = null;
target = (org.apache.xmlbeans.XmlObject)get_store().find_element_user(VUSUARIO$8, i);
if (target == null)
{
throw new IndexOutOfBoundsException();
}
target.setNil();
}
}
/**
* Inserts and returns a new empty value (as xml) as the ith "vusuario" element
*/
public org.apache.xmlbeans.XmlObject insertNewVusuario(int i)
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlObject target = null;
target = (org.apache.xmlbeans.XmlObject)get_store().insert_element_user(VUSUARIO$8, i);
return target;
}
}
/**
* Appends and returns a new empty value (as xml) as the last "vusuario" element
*/
public org.apache.xmlbeans.XmlObject addNewVusuario()
{
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlObject target = null;
target = (org.apache.xmlbeans.XmlObject)get_store().add_element_user(VUSUARIO$8);
return target;
}
}
/**
* Removes the ith "vusuario" element
*/
public void removeVusuario(int i)
{
synchronized (monitor())
{
check_orphaned();
get_store().remove_element(VUSUARIO$8, i);
}
}
}
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

