Revision: 3374
Author: [email protected]
Date: Fri Mar 12 08:43:04 2010
Log: Corrected the constructor annotations for OLAPRootObject and
OLAPSession. These objects still need to be fully annotated
correctly with the rest of the OLAP objects but these were specifically
breaking the build.
http://code.google.com/p/power-architect/source/detail?r=3374
Modified:
/trunk/regress/ca/sqlpower/architect/swingui/TestingArchitectSwingSession.java
/trunk/src/ca/sqlpower/architect/olap/OLAPRootObject.java
/trunk/src/ca/sqlpower/architect/olap/OLAPSession.java
/trunk/src/ca/sqlpower/architect/swingui/ArchitectSwingSessionImpl.java
=======================================
---
/trunk/regress/ca/sqlpower/architect/swingui/TestingArchitectSwingSession.java
Wed Mar 10 08:21:50 2010
+++
/trunk/regress/ca/sqlpower/architect/swingui/TestingArchitectSwingSession.java
Fri Mar 12 08:43:04 2010
@@ -103,7 +103,7 @@
sourceDatabases = new DBTree(this);
playpen = RelationalPlayPenFactory.createPlayPen(this,
sourceDatabases);
undoManager = new ArchitectUndoManager(playpen);
- olapRootObject = new OLAPRootObject(delegateSession);
+ olapRootObject = new OLAPRootObject();
compareDMSettings = new CompareDMSettings();
=======================================
--- /trunk/src/ca/sqlpower/architect/olap/OLAPRootObject.java Fri Mar 12
08:02:18 2010
+++ /trunk/src/ca/sqlpower/architect/olap/OLAPRootObject.java Fri Mar 12
08:43:04 2010
@@ -24,7 +24,6 @@
import java.util.Collections;
import java.util.List;
-import ca.sqlpower.architect.ArchitectSession;
import ca.sqlpower.object.SPObject;
/**
@@ -42,16 +41,9 @@
Arrays.asList(OLAPSession.class)));
- /**
- * The session this OLAPRootObject belongs to. Each Architect Session
should
- * have one OLAP Root Object, which can in turn have zero or more OLAP
Sessions.
- */
- private final ArchitectSession architectSession;
-
private final List<OLAPSession> olapSessions = new
ArrayList<OLAPSession>();
- public OLAPRootObject(ArchitectSession session) {
- this.architectSession = session;
+ public OLAPRootObject() {
}
@Override
@@ -100,13 +92,6 @@
}
return removedItem;
}
-
- /**
- * Returns the ArchtectSession this OLAP Root Object belongs to.
- */
- public ArchitectSession getArchitectSession() {
- return architectSession;
- }
public boolean allowsChildren() {
return true;
=======================================
--- /trunk/src/ca/sqlpower/architect/olap/OLAPSession.java Fri Mar 12
08:02:18 2010
+++ /trunk/src/ca/sqlpower/architect/olap/OLAPSession.java Fri Mar 12
08:43:04 2010
@@ -26,6 +26,13 @@
import ca.sqlpower.architect.olap.MondrianModel.Schema;
import ca.sqlpower.object.SPObject;
+import ca.sqlpower.object.annotation.Accessor;
+import ca.sqlpower.object.annotation.Constructor;
+import ca.sqlpower.object.annotation.ConstructorParameter;
+import ca.sqlpower.object.annotation.Mutator;
+import ca.sqlpower.object.annotation.NonProperty;
+import ca.sqlpower.object.annotation.Transient;
+import ca.sqlpower.object.annotation.ConstructorParameter.ParameterType;
import ca.sqlpower.sqlobject.SQLDatabase;
/**
@@ -65,7 +72,9 @@
*
* @param schema The schema this session owns.
*/
- public OLAPSession(Schema schema) {
+ @Constructor
+ public OLAPSession(
+ @ConstructorParameter(isProperty=ParameterType.CHILD,
propertyName="schema") Schema schema) {
if (schema.getParent() != null) {
throw new IllegalStateException(
"The given schema already belongs to an OLAP Session");
@@ -79,6 +88,7 @@
* Returns the SQLDatabase this session's schema works with.
* @return
*/
+ @Accessor
public SQLDatabase getDatabase() {
return database;
}
@@ -101,6 +111,7 @@
* @param database
* The new database to use with this session's schema.
*/
+ @Mutator
public void setDatabase(SQLDatabase database) {
this.database = database;
}
@@ -108,6 +119,7 @@
/**
* Returns this session's schema.
*/
+ @NonProperty
public Schema getSchema() {
return schema;
}
@@ -119,6 +131,7 @@
/**
* Returns a list with exactly one entry: this session's schema.
*/
+ @NonProperty
public List<Schema> getChildren() {
return Collections.singletonList(schema);
}
@@ -152,10 +165,12 @@
}
}
+ @Transient @Accessor
public List<Class<? extends SPObject>> getAllowedChildTypes() {
return allowedChildTypes;
}
+ @Transient @Accessor
public List<? extends SPObject> getDependencies() {
return Collections.singletonList(database);
}
@@ -165,6 +180,7 @@
}
@Override
+ @Mutator
public void setParent(SPObject parent) {
if (parent != null && !(parent instanceof OLAPRootObject)) {
throw new IllegalArgumentException("The parent of " +
OLAPSession.class +
@@ -174,6 +190,7 @@
}
@Override
+ @Accessor
public OLAPRootObject getParent() {
return (OLAPRootObject) super.getParent();
}
=======================================
--- /trunk/src/ca/sqlpower/architect/swingui/ArchitectSwingSessionImpl.java
Wed Mar 10 08:21:50 2010
+++ /trunk/src/ca/sqlpower/architect/swingui/ArchitectSwingSessionImpl.java
Fri Mar 12 08:43:04 2010
@@ -262,7 +262,7 @@
this.context = context;
this.delegateSession = delegateSession;
delegateSession.getWorkspace().setSession(this);
- this.olapRootObject = new OLAPRootObject(delegateSession);
+ this.olapRootObject = new OLAPRootObject();
ProfileManagerImpl profileManager = new ProfileManagerImpl();
((ArchitectSessionImpl)delegateSession).setProfileManager(profileManager);
((ArchitectSessionImpl)delegateSession).setUserPrompterFactory(this);