Author: chris.laprun(a)jboss.com
Date: 2010-02-10 12:34:37 -0500 (Wed, 10 Feb 2010)
New Revision: 1619
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java
Log:
- Do not create RegistrationPropertiesMapping if we already have one.
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java 2010-02-10
13:47:07 UTC (rev 1618)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java 2010-02-10
17:34:37 UTC (rev 1619)
@@ -1,24 +1,25 @@
/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.gatein.portal.wsrp.state.producer.registrations.mapping;
@@ -26,8 +27,8 @@
import org.chromattic.api.annotations.Id;
import org.chromattic.api.annotations.ManyToOne;
import org.chromattic.api.annotations.MappedBy;
+import org.chromattic.api.annotations.OneToOne;
import org.chromattic.api.annotations.PrimaryType;
-import org.chromattic.api.annotations.OneToOne;
import org.chromattic.api.annotations.Property;
import org.gatein.common.util.ParameterValidation;
import
org.gatein.portal.wsrp.state.producer.registrations.JCRRegistrationPersistenceManager;
@@ -89,8 +90,12 @@
Map<QName, Object> properties = registration.getProperties();
if (ParameterValidation.existsAndIsNotEmpty(properties))
{
- RegistrationPropertiesMapping rpm = createProperties();
- setProperties(rpm);
+ RegistrationPropertiesMapping rpm = getProperties();
+ if (rpm == null)
+ {
+ rpm = createProperties();
+ setProperties(rpm);
+ }
rpm.initFrom(properties);
}
}