You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by "Øyvind Harboe (JIRA)" <de...@cayenne.apache.org> on 2008/01/17 00:08:34 UTC

[JIRA] Created: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

ObjRelationsship's are not removed processing DropColumnToModel
---------------------------------------------------------------

                 Key: CAY-966
                 URL: https://issues.apache.org/cayenne/browse/CAY-966
             Project: Cayenne
          Issue Type: Bug
          Components: Cayenne Core Library
    Affects Versions: 3.0
         Environment: all
            Reporter: Øyvind Harboe
            Assignee: Andrus Adamchik


I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.

			MergerContext mergerContext = new ExecutingMergerContext(
					payBackDataMap, dataNode);
			for (MergerToken token : tokens)
			{
				if (token.getDirection() == MergeDirection.TO_DB)
				{
					token = token.createReverse(dataNode.getAdapter()
							.mergerFactory());
				}
				token.execute(mergerContext);
			}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Commented: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Tore Halset (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689#action_12689 ] 

Tore Halset commented on CAY-966:
---------------------------------

All the ToModel tokens operate on DbEntity and DbAttribute, not yet ObjEntity and ObjAttribute. 

In svn r613170 a few hours ago, I commited a patch to DropColumnToModel that also removes ObjAttributes mapped to the column. DropColumnToModel should also be able to drop ObjRelationship if a fk column is removed.

svn r613170 also contain a fix for ordering of add/remove db relationships that might be related to this issue as well. Ordering will be handled in CAY-947

All other ToModel tokens should be updated to update the Obj*-part of the model. I will work on this, but contributions including junit tests are welcome as always :)

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Commented: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Øyvind Harboe (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12701#action_12701 ] 

Øyvind Harboe commented on CAY-966:
-----------------------------------

In the code below "objEntity.getAttributeForDbAttribute(column)"= null	


    public void execute(MergerContext mergerContext) {
        // remove ObjAttribute mapped to same column
        for (ObjEntity objEntity : objEntitiesMappedToDbEntity(entity)) {
            ObjAttribute objAttribute = objEntity.getAttributeForDbAttribute(column);
            if (objAttribute != null) {
                objEntity.removeAttribute(objAttribute.getName());
            }
        }

        // remove DbAttribute
        entity.removeAttribute(column.getName());
    }


> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java, surefire-reports.zip
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Updated: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Øyvind Harboe (JIRA)" <de...@cayenne.apache.org>.
     [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Øyvind Harboe updated CAY-966:
------------------------------

    Attachment: DropColumnToModel.java

ObjRelationship's must also be removed. 

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java, DropColumnToModel.java, surefire-reports.zip
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Commented: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Tore Halset (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12711#action_12711 ] 

Tore Halset commented on CAY-966:
---------------------------------

thanks. committed

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java, DropColumnToModel.java, DropColumnToModel.java, surefire-reports.zip
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Commented: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Øyvind Harboe (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700#action_12700 ] 

Øyvind Harboe commented on CAY-966:
-----------------------------------

Unfortunally the latest version from trunk still exhibits the problem, i.e. the ObjRelationship is not removed.

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java, surefire-reports.zip
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Commented: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Øyvind Harboe (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12709#action_12709 ] 

Øyvind Harboe commented on CAY-966:
-----------------------------------

It throws a ConcurrentModificationException

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java, DropColumnToModel.java, surefire-reports.zip
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Commented: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Øyvind Harboe (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12687#action_12687 ] 

Øyvind Harboe commented on CAY-966:
-----------------------------------

> This should probably not be fixed in DbEntity, but in the DropColumnToModel token. I will take a look at it.

So I would then have to create a DromColumnToModel object to perfrom an operation as below...?

		if (!hasFooColumn())
		{
			DbEntity db=dataMap.getDbEntity("YYYY");
			db.removeAttribute("acolumn");
		}


> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Commented: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Tore Halset (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12686#action_12686 ] 

Tore Halset commented on CAY-966:
---------------------------------

This should probably not be fixed in DbEntity, but in the DropColumnToModel token. I will take a look at it.

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Resolved: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Tore Halset (JIRA)" <de...@cayenne.apache.org>.
     [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tore Halset resolved CAY-966.
-----------------------------

    Resolution: Fixed

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java, DropColumnToModel.java, DropColumnToModel.java, surefire-reports.zip
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Commented: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Øyvind Harboe (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12702#action_12702 ] 

Øyvind Harboe commented on CAY-966:
-----------------------------------

Normally there should be no attribute when a relationship has been set up for a column, so that's why getAttrbitueForDbAttribute() returns null.



> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java, surefire-reports.zip
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Updated: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Øyvind Harboe (JIRA)" <de...@cayenne.apache.org>.
     [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Øyvind Harboe updated CAY-966:
------------------------------

    Attachment: surefire-reports.zip

Hopefully contains information about what failed in the build.

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java, surefire-reports.zip
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Closed: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Tore Halset (JIRA)" <de...@cayenne.apache.org>.
     [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tore Halset closed CAY-966.
---------------------------


> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java, DropColumnToModel.java, DropColumnToModel.java, surefire-reports.zip
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Commented: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Øyvind Harboe (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12691#action_12691 ] 

Øyvind Harboe commented on CAY-966:
-----------------------------------

I can test this tomorrow if I there is a snapshot I can download... Do daily snapshots exist of Cayenne?

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Commented: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Tore Halset (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12708#action_12708 ] 

Tore Halset commented on CAY-966:
---------------------------------

Thanks for the patch. I have committed a similar fix inspired by yours. Here are a list of the changes from your patch.

 * Remove reverse ObjRelationship as well
 * Remove DbRelationship (still in the model) as well. Including reverse.
 * junit tests

I hope this works as expected by you

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java, DropColumnToModel.java, surefire-reports.zip
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Commented: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Tore Halset (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12690#action_12690 ] 

Tore Halset commented on CAY-966:
---------------------------------

I think this one is fixed in svn trunk now. Could you test Øyvind?

The most important ToModel tokens are now updated to also handle the Obj-side of the model.

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Updated: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Øyvind Harboe (JIRA)" <de...@cayenne.apache.org>.
     [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Øyvind Harboe updated CAY-966:
------------------------------

    Attachment: DropColumnToModel.java

Duplicate list before iterating over it as the original list will be modified during the loop.

I chose to duplicate the list as it has a very straightforward codepath rather than the more fancy approach of adding all items to be removed to the list and removing them afterwards. I can't imagine that this is performance sensitive code so testability is probably what to optimise for.

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java, DropColumnToModel.java, DropColumnToModel.java, surefire-reports.zip
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Commented: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Tore Halset (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12693#action_12693 ] 

Tore Halset commented on CAY-966:
---------------------------------

I do not know of any nightly build of cayenne, but it should not be that hard to build one yourself. It is also not so long before M3.

svn co https://svn.apache.org/repos/asf/cayenne/main/trunk/ cayenne
cd cayenne
mvn

After some minutes, this should result in a jar file:
framework/cayenne-server/target/cayenne-server-3.0-SNAPSHOT.jar 


> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Commented: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Øyvind Harboe (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12697#action_12697 ] 

Øyvind Harboe commented on CAY-966:
-----------------------------------

This seemed to work:

mvn -Dmaven.test.skip=true install

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java, surefire-reports.zip
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Commented: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Tore Halset (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714#action_12714 ] 

Tore Halset commented on CAY-966:
---------------------------------

can we close this one?

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java, DropColumnToModel.java, DropColumnToModel.java, surefire-reports.zip
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Commented: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Øyvind Harboe (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688#action_12688 ] 

Øyvind Harboe commented on CAY-966:
-----------------------------------

My workaround does is no good for relationships that cross DataMap's.

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: build failure

Posted by Andrus Adamchik <an...@objectstyle.org>.
BTW, I think I had a similar exception on Cayenne Solaris zone...  
which I can't retest as the zone is down...

Andrus


On Jan 21, 2008, at 12:52 PM, Aristedes Maniatis wrote:
> On 21/01/2008, at 9:14 PM, Øyvind Harboe (JIRA) wrote:
>
>> The build failed....
>>
>>
>> INFO: SELECT t0.ARTIST_NAME, t0.ARTIST_ID, t0.DATE_OF_BIRTH FROM  
>> ARTIST t0 WHERE
>> t0.ARTIST_ID = ? [bind: 1->ARTIST_ID:33002]
>> Jan 21, 2008 10:13:36 AM org.apache.cayenne.access.QueryLogger  
>> logSelectCount
>> INFO: === returned 1 row. - took 1 ms.
>> Jan 21, 2008 10:13:36 AM org.apache.cayenne.access.QueryLogger  
>> logCommitTransact
>> ion
>> INFO: +++ transaction committed.
>> Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:  
>> 0.458 sec
>>
>> Results :
>>
>> Tests in error:
>> testConstructorWithProperties 
>> (org.apache.cayenne.access.DataRowStoreTest)
>
>
> Caused by: ChannelException: java.lang.Exception: exception caused  
> by UDP.start(): java.net.SocketException: bad argument for  
> IP_MULTICAST_IF: address not bound to any interface
>
>
> Could this be something unusual in the network setup on your  
> machine? Firewalling? Something else?
>
>
> Ari Maniatis
>
>
> -------------------------->
> ish
> http://www.ish.com.au
> Level 1, 30 Wilson Street Newtown 2042 Australia
> phone +61 2 9550 5001   fax +61 2 9550 4001
> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
>
>
>


Re: build failure

Posted by Aristedes Maniatis <ar...@ish.com.au>.
On 21/01/2008, at 9:14 PM, Øyvind Harboe (JIRA) wrote:

> The build failed....
>
>
> INFO: SELECT t0.ARTIST_NAME, t0.ARTIST_ID, t0.DATE_OF_BIRTH FROM  
> ARTIST t0 WHERE
> t0.ARTIST_ID = ? [bind: 1->ARTIST_ID:33002]
> Jan 21, 2008 10:13:36 AM org.apache.cayenne.access.QueryLogger  
> logSelectCount
> INFO: === returned 1 row. - took 1 ms.
> Jan 21, 2008 10:13:36 AM org.apache.cayenne.access.QueryLogger  
> logCommitTransact
> ion
> INFO: +++ transaction committed.
> Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:  
> 0.458 sec
>
> Results :
>
> Tests in error:
>   
> testConstructorWithProperties 
> (org.apache.cayenne.access.DataRowStoreTest)


Caused by: ChannelException: java.lang.Exception: exception caused by  
UDP.start(): java.net.SocketException: bad argument for  
IP_MULTICAST_IF: address not bound to any interface


Could this be something unusual in the network setup on your machine?  
Firewalling? Something else?


Ari Maniatis


-------------------------->
ish
http://www.ish.com.au
Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001   fax +61 2 9550 4001
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A



[JIRA] Commented: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Øyvind Harboe (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12695#action_12695 ] 

Øyvind Harboe commented on CAY-966:
-----------------------------------

The build failed....


INFO: SELECT t0.ARTIST_NAME, t0.ARTIST_ID, t0.DATE_OF_BIRTH FROM ARTIST t0 WHERE
 t0.ARTIST_ID = ? [bind: 1->ARTIST_ID:33002]
Jan 21, 2008 10:13:36 AM org.apache.cayenne.access.QueryLogger logSelectCount
INFO: === returned 1 row. - took 1 ms.
Jan 21, 2008 10:13:36 AM org.apache.cayenne.access.QueryLogger logCommitTransact
ion
INFO: +++ transaction committed.
Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.458 sec

Results :

Tests in error:
  testConstructorWithProperties(org.apache.cayenne.access.DataRowStoreTest)

Tests run: 1920, Failures: 0, Errors: 1, Skipped: 0

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.

Please refer to /home/oyvind/cayenne/framework/cayenne-jdk1.5-unpublished/target
/surefire-reports for the individual test results.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 2 seconds
[INFO] Finished at: Mon Jan 21 10:13:36 GMT 2008
[INFO] Final Memory: 17M/39M
[INFO] ------------------------------------------------------------------------
oyvind@pest:~/cayenne$

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Commented: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Øyvind Harboe (JIRA)" <de...@cayenne.apache.org>.
    [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12716#action_12716 ] 

Øyvind Harboe commented on CAY-966:
-----------------------------------

Works on my rocket. Close.

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java, DropColumnToModel.java, DropColumnToModel.java, surefire-reports.zip
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Updated: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Øyvind Harboe (JIRA)" <de...@cayenne.apache.org>.
     [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Øyvind Harboe updated CAY-966:
------------------------------

    Attachment: DbEntity.java

Search for "// Kludge!!! Remove object relationships related to this attribute"

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Andrus Adamchik
>         Attachments: DbEntity.java
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[JIRA] Assigned: (CAY-966) ObjRelationsship's are not removed processing DropColumnToModel

Posted by "Tore Halset (JIRA)" <de...@cayenne.apache.org>.
     [ https://issues.apache.org/cayenne/browse/CAY-966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tore Halset reassigned CAY-966:
-------------------------------

    Assignee: Tore Halset  (was: Andrus Adamchik)

> ObjRelationsship's are not removed processing DropColumnToModel
> ---------------------------------------------------------------
>
>                 Key: CAY-966
>                 URL: https://issues.apache.org/cayenne/browse/CAY-966
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.0
>         Environment: all
>            Reporter: Øyvind Harboe
>            Assignee: Tore Halset
>         Attachments: DbEntity.java
>
>
> I'll attatch a modified DbEntity.java that fixes the problem here....  Basically the code below won't work right because the ObjRelationship's aren't removed.
> 			MergerContext mergerContext = new ExecutingMergerContext(
> 					payBackDataMap, dataNode);
> 			for (MergerToken token : tokens)
> 			{
> 				if (token.getDirection() == MergeDirection.TO_DB)
> 				{
> 					token = token.createReverse(dataNode.getAdapter()
> 							.mergerFactory());
> 				}
> 				token.execute(mergerContext);
> 			}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.