Skip to content

Commit

Permalink
Moved source from partials branch to integration
Browse files Browse the repository at this point in the history
  • Loading branch information
David Aspinall committed Sep 13, 2012
1 parent c335dc0 commit 6337f10
Show file tree
Hide file tree
Showing 95 changed files with 3,786 additions and 1 deletion.
20 changes: 20 additions & 0 deletions Examples/ERXPartials/ERXPartialBaseModel/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="Sources"/>
<classpathentry kind="src" path="GeneratedEOs"/>
<classpathentry kind="con" path="WOFramework/ERExtensions"/>
<classpathentry kind="con" path="WOFramework/ERJars"/>
<classpathentry kind="con" path="WOFramework/ERPrototypes"/>
<classpathentry kind="con" path="WOFramework/JavaWOExtensions"/>
<classpathentry kind="con" path="WOFramework/WOOgnl"/>
<classpathentry kind="con" path="WOFramework/JavaEOAccess"/>
<classpathentry kind="con" path="WOFramework/JavaEOControl"/>
<classpathentry kind="con" path="WOFramework/JavaFoundation"/>
<classpathentry kind="con" path="WOFramework/JavaJDBCAdaptor"/>
<classpathentry kind="con" path="WOFramework/JavaWebObjects"/>
<classpathentry kind="con" path="WOFramework/JavaXML"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="WOFramework/JavaMemoryAdaptor"/>
<classpathentry kind="con" path="WOFramework/FrontBasePlugIn"/>
<classpathentry kind="output" path="bin"/>
</classpath>
23 changes: 23 additions & 0 deletions Examples/ERXPartials/ERXPartialBaseModel/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ERXPartialBaseModel</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.objectstyle.wolips.incrementalbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.objectstyle.wolips.incrementalframeworknature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding//Components=UTF-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
// $LastChangedRevision: 4733 $ DO NOT EDIT. Make changes to GenderType.java instead.
package er.example.erxpartials.model;

import com.webobjects.eoaccess.*;
import com.webobjects.eocontrol.*;
import com.webobjects.foundation.*;
import java.math.*;
import java.util.*;
import org.apache.log4j.Logger;

import er.extensions.eof.*;
import er.extensions.foundation.*;

@SuppressWarnings("all")
public abstract class _GenderType extends ERXGenericRecord {
public static final String ENTITY_NAME = "GenderType";

// Attribute Keys
public static final ERXKey<String> NAME = new ERXKey<String>("name");
// Relationship Keys
public static final ERXKey<er.example.erxpartials.model.Person> PERSONS = new ERXKey<er.example.erxpartials.model.Person>("persons");

// Attributes
public static final String NAME_KEY = NAME.key();
// Relationships
public static final String PERSONS_KEY = PERSONS.key();

private static Logger LOG = Logger.getLogger(_GenderType.class);

public GenderType localInstanceIn(EOEditingContext editingContext) {
GenderType localInstance = (GenderType)EOUtilities.localInstanceOfObject(editingContext, this);
if (localInstance == null) {
throw new IllegalStateException("You attempted to localInstance " + this + ", which has not yet committed.");
}
return localInstance;
}

public String name() {
return (String) storedValueForKey("name");
}

public void setName(String value) {
if (_GenderType.LOG.isDebugEnabled()) {
_GenderType.LOG.debug( "updating name from " + name() + " to " + value);
}
takeStoredValueForKey(value, "name");
}

public NSArray<er.example.erxpartials.model.Person> persons() {
return (NSArray<er.example.erxpartials.model.Person>)storedValueForKey("persons");
}

public NSArray<er.example.erxpartials.model.Person> persons(EOQualifier qualifier) {
return persons(qualifier, null, false);
}

public NSArray<er.example.erxpartials.model.Person> persons(EOQualifier qualifier, boolean fetch) {
return persons(qualifier, null, fetch);
}

public NSArray<er.example.erxpartials.model.Person> persons(EOQualifier qualifier, NSArray<EOSortOrdering> sortOrderings, boolean fetch) {
NSArray<er.example.erxpartials.model.Person> results;
if (fetch) {
EOQualifier fullQualifier;
EOQualifier inverseQualifier = new EOKeyValueQualifier(er.example.erxpartials.model.Person.GENDER_TYPE_KEY, EOQualifier.QualifierOperatorEqual, this);

if (qualifier == null) {
fullQualifier = inverseQualifier;
}
else {
NSMutableArray qualifiers = new NSMutableArray();
qualifiers.addObject(qualifier);
qualifiers.addObject(inverseQualifier);
fullQualifier = new EOAndQualifier(qualifiers);
}

results = er.example.erxpartials.model.Person.fetchPersons(editingContext(), fullQualifier, sortOrderings);
}
else {
results = persons();
if (qualifier != null) {
results = (NSArray<er.example.erxpartials.model.Person>)EOQualifier.filteredArrayWithQualifier(results, qualifier);
}
if (sortOrderings != null) {
results = (NSArray<er.example.erxpartials.model.Person>)EOSortOrdering.sortedArrayUsingKeyOrderArray(results, sortOrderings);
}
}
return results;
}

public void addToPersons(er.example.erxpartials.model.Person object) {
includeObjectIntoPropertyWithKey(object, "persons");
}

public void removeFromPersons(er.example.erxpartials.model.Person object) {
excludeObjectFromPropertyWithKey(object, "persons");
}

public void addToPersonsRelationship(er.example.erxpartials.model.Person object) {
if (_GenderType.LOG.isDebugEnabled()) {
_GenderType.LOG.debug("adding " + object + " to persons relationship");
}
if (er.extensions.eof.ERXGenericRecord.InverseRelationshipUpdater.updateInverseRelationships()) {
addToPersons(object);
}
else {
addObjectToBothSidesOfRelationshipWithKey(object, "persons");
}
}

public void removeFromPersonsRelationship(er.example.erxpartials.model.Person object) {
if (_GenderType.LOG.isDebugEnabled()) {
_GenderType.LOG.debug("removing " + object + " from persons relationship");
}
if (er.extensions.eof.ERXGenericRecord.InverseRelationshipUpdater.updateInverseRelationships()) {
removeFromPersons(object);
}
else {
removeObjectFromBothSidesOfRelationshipWithKey(object, "persons");
}
}

public er.example.erxpartials.model.Person createPersonsRelationship() {
EOClassDescription eoClassDesc = EOClassDescription.classDescriptionForEntityName("Person");
EOEnterpriseObject eo = eoClassDesc.createInstanceWithEditingContext(editingContext(), null);
editingContext().insertObject(eo);
addObjectToBothSidesOfRelationshipWithKey(eo, "persons");
return (er.example.erxpartials.model.Person) eo;
}

public void deletePersonsRelationship(er.example.erxpartials.model.Person object) {
removeObjectFromBothSidesOfRelationshipWithKey(object, "persons");
editingContext().deleteObject(object);
}

public void deleteAllPersonsRelationships() {
Enumeration objects = persons().immutableClone().objectEnumerator();
while (objects.hasMoreElements()) {
deletePersonsRelationship((er.example.erxpartials.model.Person)objects.nextElement());
}
}


public static GenderType createGenderType(EOEditingContext editingContext, String name
) {
GenderType eo = (GenderType) EOUtilities.createAndInsertInstance(editingContext, _GenderType.ENTITY_NAME);
eo.setName(name);
return eo;
}

public static NSArray<GenderType> fetchAllGenderTypes(EOEditingContext editingContext) {
return _GenderType.fetchAllGenderTypes(editingContext, null);
}

public static NSArray<GenderType> fetchAllGenderTypes(EOEditingContext editingContext, NSArray<EOSortOrdering> sortOrderings) {
return _GenderType.fetchGenderTypes(editingContext, null, sortOrderings);
}

public static NSArray<GenderType> fetchGenderTypes(EOEditingContext editingContext, EOQualifier qualifier, NSArray<EOSortOrdering> sortOrderings) {
EOFetchSpecification fetchSpec = new EOFetchSpecification(_GenderType.ENTITY_NAME, qualifier, sortOrderings);
fetchSpec.setIsDeep(true);
NSArray<GenderType> eoObjects = (NSArray<GenderType>)editingContext.objectsWithFetchSpecification(fetchSpec);
return eoObjects;
}

public static GenderType fetchGenderType(EOEditingContext editingContext, String keyName, Object value) {
return _GenderType.fetchGenderType(editingContext, new EOKeyValueQualifier(keyName, EOQualifier.QualifierOperatorEqual, value));
}

public static GenderType fetchGenderType(EOEditingContext editingContext, EOQualifier qualifier) {
NSArray<GenderType> eoObjects = _GenderType.fetchGenderTypes(editingContext, qualifier, null);
GenderType eoObject;
int count = eoObjects.count();
if (count == 0) {
eoObject = null;
}
else if (count == 1) {
eoObject = (GenderType)eoObjects.objectAtIndex(0);
}
else {
throw new IllegalStateException("There was more than one GenderType that matched the qualifier '" + qualifier + "'.");
}
return eoObject;
}

public static GenderType fetchRequiredGenderType(EOEditingContext editingContext, String keyName, Object value) {
return _GenderType.fetchRequiredGenderType(editingContext, new EOKeyValueQualifier(keyName, EOQualifier.QualifierOperatorEqual, value));
}

public static GenderType fetchRequiredGenderType(EOEditingContext editingContext, EOQualifier qualifier) {
GenderType eoObject = _GenderType.fetchGenderType(editingContext, qualifier);
if (eoObject == null) {
throw new NoSuchElementException("There was no GenderType that matched the qualifier '" + qualifier + "'.");
}
return eoObject;
}

public static GenderType localInstanceIn(EOEditingContext editingContext, GenderType eo) {
GenderType localInstance = (eo == null) ? null : (GenderType)EOUtilities.localInstanceOfObject(editingContext, eo);
if (localInstance == null && eo != null) {
throw new IllegalStateException("You attempted to localInstance " + eo + ", which has not yet committed.");
}
return localInstance;
}
}
Loading

0 comments on commit 6337f10

Please sign in to comment.