On Sunday 05 June 2005 02:23, Andrus Adamchik wrote:
> Then this should be something very simple and probably in your
> code... Could you put a log statement somewhere in
> "getSortedSectionArray" to make sure it is called after the update
> (as you maybe caching it somewhere in your code)...
>
> Also is "sectionArray" relationship defined as two-way (i.e. is there
> a reverse relationship like "section.toWhatever" pointing back to the
> original object)? It has be defined like that for the changes to be
> seen immediately.
According to the cayenne modeler, the section array is a to-many property.
This is the generated _Section:
public class _Section extends org.objectstyle.cayenne.CayenneDataObject {
public static final String SECTION_ARRAY_PROPERTY = "sectionArray";
public void addToSectionArray(databaseExt.Section obj) {
addToManyTarget("sectionArray", obj, true);
}
public void removeFromSectionArray(databaseExt.Section obj) {
removeToManyTarget("sectionArray", obj, true);
}
public List getSectionArray() {
return (List)readProperty("sectionArray");
}
This is in the derived Section:
synchronized static public Section createSection(DataContext context, Section
parent, Layer toLayer, Short sectionNr){
Section newsection = (Section)
context.createAndRegisterNewObject(Section.class);
newsection.setSectionnumber(sectionNr);
newsection.setToLayer(toLayer);
newsection.setToSection(parent);
newsection.setSectionname("Section Title");
context.commitChanges();
return newsection;
}
Can you explain how i can write to a file using log4j?
>
> Andrus
--Koen Segers
<koenseger..carlet.be> <http://eddyvite.dyndns.org>
This archive was generated by hypermail 2.0.0 : Sun Jun 05 2005 - 06:58:18 EDT