You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shale.apache.org by ra...@apache.org on 2006/09/14 22:22:19 UTC

svn commit: r443457 - /shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/

Author: rahul
Date: Thu Sep 14 13:22:18 2006
New Revision: 443457

URL: http://svn.apache.org/viewvc?view=rev&rev=443457
Log:
Add props to missing bits in r443202, hope you don't mind Gary ...

Modified:
    shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/AbstractFacade.java   (contents, props changed)
    shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ActionListenerConfigBeanFacadeImpl.java   (contents, props changed)
    shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ComponentConfigBeanFacadeImpl.java   (contents, props changed)
    shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ConverterConfigBeanFacadeImpl.java   (contents, props changed)
    shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ElementConfigBeanFacadeImpl.java   (contents, props changed)
    shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ValidatorConfigBeanFacadeImpl.java   (contents, props changed)
    shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ValueChangeListenerConfigBeanFacadeImpl.java   (contents, props changed)

Modified: shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/AbstractFacade.java
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/AbstractFacade.java?view=diff&rev=443457&r1=443456&r2=443457
==============================================================================
--- shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/AbstractFacade.java (original)
+++ shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/AbstractFacade.java Thu Sep 14 13:22:18 2006
@@ -1,182 +1,182 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shale.clay.configjpa.services.impl;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.NoResultException;
-
-import org.apache.shale.clay.configjpa.beans.AbstractComponentBeanDef;
-import org.apache.shale.clay.configjpa.beans.AttributeBeanDef;
-import org.apache.shale.clay.configjpa.beans.SymbolBeanDef;
-
-public abstract class AbstractFacade implements Serializable {
-
-    private static final long serialVersionUID = -1186517417459495627L;
-
-    
-    private EntityManager entityManager = null;
-
-
-    /**
-     * @return the entityManager
-     */
-    public EntityManager getEntityManager() {
-        return entityManager;
-    }
-
-
-    /**
-     * @param entityManager the entityManager to set
-     */
-    public void setEntityManager(EntityManager entityManager) {
-        this.entityManager = entityManager;
-    }
-    
-    
-    
-    protected List<AttributeBeanDef> findAttributes(AbstractComponentBeanDef owner) {
-        EntityManager em = getEntityManager();
-        List<AttributeBeanDef> attributes = null;
-        try {
-            attributes = em.createNamedQuery("findAttributesByOwner")
-                    .setParameter("ownerId", owner.getId())
-                    .setParameter("ownershipType", owner.getType()).getResultList();
-        } catch (NoResultException e) {
-            attributes = null;
-        }
-        return attributes;
-    }
-
-    
-    protected void persistSymbolsAttributes(AbstractComponentBeanDef owner, List[] children) {
- 
-        for (List childList: children) {
-            if (!childList.isEmpty()) {
-                if (childList.get(0) instanceof AttributeBeanDef) {
-                    List<AttributeBeanDef> tmp = new ArrayList<AttributeBeanDef>(childList);
-                    persistAttributes(owner, tmp);    
-                } else if (childList.get(0) instanceof SymbolBeanDef) {
-                    List<SymbolBeanDef> tmp = new ArrayList<SymbolBeanDef>(childList);
-                    persistSymbols(owner, tmp);    
-                }  
-            }
-        }
-
-        
-    }
-    
-    
-    private void persistAttributes(AbstractComponentBeanDef owner, List<AttributeBeanDef> attributes) {
-        EntityManager em = getEntityManager();
-        
-        for (AttributeBeanDef n : attributes) {
-
-            AttributeBeanDef a = findAttribute(owner, n.getName());
-            if (a == null) {
-                a = n;
-                a.setOwnerId(owner.getId());
-                a.setOwnershipType(owner.getType());
-            } else {
-                a.setBindingType(n.getBindingType());
-                a.setDescription(n.getDescription());
-                a.setValue(n.getValue());
-            }
-
-           em.persist(a);
-           
-        }
-
-    }
-    
-    protected AttributeBeanDef findAttribute(AbstractComponentBeanDef owner, String name) {
-        EntityManager em = getEntityManager();
-        AttributeBeanDef a = null;
-        try {
-            a = (AttributeBeanDef) em.createNamedQuery("findAttributeByOwnerName")
-                    .setParameter("ownerId", owner.getId())
-                    .setParameter("ownershipType", owner.getType())
-                    .setParameter("name", name).getSingleResult();
-        } catch (NoResultException e) {
-            a = null;
-        }
-        return a;
-    }
-    
-    
-    
-    protected List<SymbolBeanDef> findSymbols(AbstractComponentBeanDef owner) {
-        EntityManager em = getEntityManager();
-        List<SymbolBeanDef> symbols = null;
-
-        try {
-            symbols = em.createNamedQuery("findComponentSymbolsByOwner")
-                    .setParameter("ownerId", owner.getId())
-                    .setParameter("ownershipType", owner.getType())
-                    .getResultList();
-        } catch (NoResultException e) {
-            symbols = null;
-        }
-        
-        return symbols;
-    }
-
-    private SymbolBeanDef findSymbol(AbstractComponentBeanDef owner, String name) {
-        EntityManager em = getEntityManager();
-        SymbolBeanDef s = null;
-
-        try {
-            s = (SymbolBeanDef) em.createNamedQuery(
-                    "findComponentSymbolByOwnerName")
-                    .setParameter("ownerId", owner.getId())
-                    .setParameter("ownershipType", owner.getType())
-                    .setParameter("name", name).getSingleResult();
-        } catch (NoResultException e) {
-            s = null;
-        }
-        
-        return s;
-    }
-
-    
-    private void persistSymbols(AbstractComponentBeanDef owner, List<SymbolBeanDef> symbols) {
-        EntityManager em = getEntityManager();
-
-        for (SymbolBeanDef n : symbols) {
-            SymbolBeanDef s = findSymbol(owner, n.getName());
-
-            if (s == null) {
-                s = n;
-                s.setOwnerId(owner.getId());
-                s.setOwnershipType(owner.getType());
-            } else {
-                s.setDescription(n.getDescription());
-                s.setValue(n.getValue());
-
-            }
-
-            em.persist(s);
-        }
-
-    }
-
-    
-    
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shale.clay.configjpa.services.impl;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+
+import org.apache.shale.clay.configjpa.beans.AbstractComponentBeanDef;
+import org.apache.shale.clay.configjpa.beans.AttributeBeanDef;
+import org.apache.shale.clay.configjpa.beans.SymbolBeanDef;
+
+public abstract class AbstractFacade implements Serializable {
+
+    private static final long serialVersionUID = -1186517417459495627L;
+
+    
+    private EntityManager entityManager = null;
+
+
+    /**
+     * @return the entityManager
+     */
+    public EntityManager getEntityManager() {
+        return entityManager;
+    }
+
+
+    /**
+     * @param entityManager the entityManager to set
+     */
+    public void setEntityManager(EntityManager entityManager) {
+        this.entityManager = entityManager;
+    }
+    
+    
+    
+    protected List<AttributeBeanDef> findAttributes(AbstractComponentBeanDef owner) {
+        EntityManager em = getEntityManager();
+        List<AttributeBeanDef> attributes = null;
+        try {
+            attributes = em.createNamedQuery("findAttributesByOwner")
+                    .setParameter("ownerId", owner.getId())
+                    .setParameter("ownershipType", owner.getType()).getResultList();
+        } catch (NoResultException e) {
+            attributes = null;
+        }
+        return attributes;
+    }
+
+    
+    protected void persistSymbolsAttributes(AbstractComponentBeanDef owner, List[] children) {
+ 
+        for (List childList: children) {
+            if (!childList.isEmpty()) {
+                if (childList.get(0) instanceof AttributeBeanDef) {
+                    List<AttributeBeanDef> tmp = new ArrayList<AttributeBeanDef>(childList);
+                    persistAttributes(owner, tmp);    
+                } else if (childList.get(0) instanceof SymbolBeanDef) {
+                    List<SymbolBeanDef> tmp = new ArrayList<SymbolBeanDef>(childList);
+                    persistSymbols(owner, tmp);    
+                }  
+            }
+        }
+
+        
+    }
+    
+    
+    private void persistAttributes(AbstractComponentBeanDef owner, List<AttributeBeanDef> attributes) {
+        EntityManager em = getEntityManager();
+        
+        for (AttributeBeanDef n : attributes) {
+
+            AttributeBeanDef a = findAttribute(owner, n.getName());
+            if (a == null) {
+                a = n;
+                a.setOwnerId(owner.getId());
+                a.setOwnershipType(owner.getType());
+            } else {
+                a.setBindingType(n.getBindingType());
+                a.setDescription(n.getDescription());
+                a.setValue(n.getValue());
+            }
+
+           em.persist(a);
+           
+        }
+
+    }
+    
+    protected AttributeBeanDef findAttribute(AbstractComponentBeanDef owner, String name) {
+        EntityManager em = getEntityManager();
+        AttributeBeanDef a = null;
+        try {
+            a = (AttributeBeanDef) em.createNamedQuery("findAttributeByOwnerName")
+                    .setParameter("ownerId", owner.getId())
+                    .setParameter("ownershipType", owner.getType())
+                    .setParameter("name", name).getSingleResult();
+        } catch (NoResultException e) {
+            a = null;
+        }
+        return a;
+    }
+    
+    
+    
+    protected List<SymbolBeanDef> findSymbols(AbstractComponentBeanDef owner) {
+        EntityManager em = getEntityManager();
+        List<SymbolBeanDef> symbols = null;
+
+        try {
+            symbols = em.createNamedQuery("findComponentSymbolsByOwner")
+                    .setParameter("ownerId", owner.getId())
+                    .setParameter("ownershipType", owner.getType())
+                    .getResultList();
+        } catch (NoResultException e) {
+            symbols = null;
+        }
+        
+        return symbols;
+    }
+
+    private SymbolBeanDef findSymbol(AbstractComponentBeanDef owner, String name) {
+        EntityManager em = getEntityManager();
+        SymbolBeanDef s = null;
+
+        try {
+            s = (SymbolBeanDef) em.createNamedQuery(
+                    "findComponentSymbolByOwnerName")
+                    .setParameter("ownerId", owner.getId())
+                    .setParameter("ownershipType", owner.getType())
+                    .setParameter("name", name).getSingleResult();
+        } catch (NoResultException e) {
+            s = null;
+        }
+        
+        return s;
+    }
+
+    
+    private void persistSymbols(AbstractComponentBeanDef owner, List<SymbolBeanDef> symbols) {
+        EntityManager em = getEntityManager();
+
+        for (SymbolBeanDef n : symbols) {
+            SymbolBeanDef s = findSymbol(owner, n.getName());
+
+            if (s == null) {
+                s = n;
+                s.setOwnerId(owner.getId());
+                s.setOwnershipType(owner.getType());
+            } else {
+                s.setDescription(n.getDescription());
+                s.setValue(n.getValue());
+
+            }
+
+            em.persist(s);
+        }
+
+    }
+
+    
+    
+}

Propchange: shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/AbstractFacade.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ActionListenerConfigBeanFacadeImpl.java
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ActionListenerConfigBeanFacadeImpl.java?view=diff&rev=443457&r1=443456&r2=443457
==============================================================================
--- shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ActionListenerConfigBeanFacadeImpl.java (original)
+++ shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ActionListenerConfigBeanFacadeImpl.java Thu Sep 14 13:22:18 2006
@@ -1,132 +1,132 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shale.clay.configjpa.services.impl;
-
-import java.io.Serializable;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.NoResultException;
-
-import org.apache.shale.clay.configjpa.beans.AbstractComponentBeanDef;
-import org.apache.shale.clay.configjpa.beans.ActionListenerBeanDef;
-import org.apache.shale.clay.configjpa.beans.AttributeBeanDef;
-import org.apache.shale.clay.configjpa.beans.ComponentBeanDef;
-import org.apache.shale.clay.configjpa.beans.ElementBeanDef;
-import org.apache.shale.clay.configjpa.beans.SymbolBeanDef;
-import org.apache.shale.clay.configjpa.services.ActionListenerConfigBeanFacade;
-
-public class ActionListenerConfigBeanFacadeImpl extends AbstractFacade
-        implements Serializable, ActionListenerConfigBeanFacade {
-
-    private static final long serialVersionUID = -7582880061907015452L;
-
-    public AbstractComponentBeanDef persist(ComponentBeanDef owner,
-            ActionListenerBeanDef ActionListener, List... children) {
-        return persistImpl(owner, ActionListener, children);
-    }
-
-    public ActionListenerBeanDef findByJsfid(ComponentBeanDef owner,
-            String jsfid) {
-        return findByJsfidImpl(owner, jsfid);
-    }
-
-    public AbstractComponentBeanDef persist(ElementBeanDef owner,
-            ActionListenerBeanDef ActionListener, List... children) {
-        return persistImpl(owner, ActionListener, children);
-    }
-
-    public ActionListenerBeanDef findByJsfid(ElementBeanDef owner, String jsfid) {
-        return findByJsfidImpl(owner, jsfid);
-    }
-
-    private AbstractComponentBeanDef persistImpl(
-            AbstractComponentBeanDef owner,
-            ActionListenerBeanDef actionListener, List[] children) {
-        EntityManager em = getEntityManager();
-
-        // make sure the component exists and is current
-        ActionListenerBeanDef a = findByJsfidImpl(
-                owner, actionListener.getJsfid());
-
-        // ActionListener doesn't already exist; fixup ownership
-        if (a == null) {
-            a = actionListener;
-            a.setOwnerId(owner.getId());
-            a.setOwnershipType(owner.getType());
-        } else {
-            a.setJsfid(actionListener.getJsfid());
-            a.setDescription(actionListener.getDescription());
-        }
-
-        em.persist(a);
-
-        persistSymbolsAttributes(a, children);
-
-        return a;
-    }
-
-    private ActionListenerBeanDef findByJsfidImpl(
-            AbstractComponentBeanDef owner, String jsfid) {
-        EntityManager em = getEntityManager();
-        ActionListenerBeanDef actionListener = null;
-        try {
-            actionListener = (ActionListenerBeanDef) em.createNamedQuery(
-                    "findActionListenerByJsfid").setParameter("ownerId",
-                    owner.getId()).setParameter("ownershipType",
-                    owner.getType()).setParameter("jsfid", jsfid)
-                    .getSingleResult();
-
-        } catch (NoResultException e) {
-            actionListener = null;
-        }
-        return actionListener;
-    }
-
-
-    public List<AttributeBeanDef> findAttributes(ActionListenerBeanDef owner) {
-        return super.findAttributes(owner);
-    }
-
-    public List<SymbolBeanDef> findSymbols(ActionListenerBeanDef owner) {
-        return super.findSymbols(owner);
-    }
-
-    
-    private List<ActionListenerBeanDef> findAllImpl(
-            AbstractComponentBeanDef owner) {
-        EntityManager em = getEntityManager();
-        List<ActionListenerBeanDef> children = null;
-
-        children = em.createNamedQuery(
-                "findActionListeners").setParameter("ownerId", owner.getId())
-                .setParameter("ownershipType", owner.getType()).getResultList();
-
-        return children;
-    }
-
-    public List<ActionListenerBeanDef> findAll(ComponentBeanDef owner) {
-        return findAllImpl(owner);
-    }
-
-    public List<ActionListenerBeanDef> findAll(ElementBeanDef owner) {
-        return findAllImpl(owner);
-    }
-
-    
-    
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shale.clay.configjpa.services.impl;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+
+import org.apache.shale.clay.configjpa.beans.AbstractComponentBeanDef;
+import org.apache.shale.clay.configjpa.beans.ActionListenerBeanDef;
+import org.apache.shale.clay.configjpa.beans.AttributeBeanDef;
+import org.apache.shale.clay.configjpa.beans.ComponentBeanDef;
+import org.apache.shale.clay.configjpa.beans.ElementBeanDef;
+import org.apache.shale.clay.configjpa.beans.SymbolBeanDef;
+import org.apache.shale.clay.configjpa.services.ActionListenerConfigBeanFacade;
+
+public class ActionListenerConfigBeanFacadeImpl extends AbstractFacade
+        implements Serializable, ActionListenerConfigBeanFacade {
+
+    private static final long serialVersionUID = -7582880061907015452L;
+
+    public AbstractComponentBeanDef persist(ComponentBeanDef owner,
+            ActionListenerBeanDef ActionListener, List... children) {
+        return persistImpl(owner, ActionListener, children);
+    }
+
+    public ActionListenerBeanDef findByJsfid(ComponentBeanDef owner,
+            String jsfid) {
+        return findByJsfidImpl(owner, jsfid);
+    }
+
+    public AbstractComponentBeanDef persist(ElementBeanDef owner,
+            ActionListenerBeanDef ActionListener, List... children) {
+        return persistImpl(owner, ActionListener, children);
+    }
+
+    public ActionListenerBeanDef findByJsfid(ElementBeanDef owner, String jsfid) {
+        return findByJsfidImpl(owner, jsfid);
+    }
+
+    private AbstractComponentBeanDef persistImpl(
+            AbstractComponentBeanDef owner,
+            ActionListenerBeanDef actionListener, List[] children) {
+        EntityManager em = getEntityManager();
+
+        // make sure the component exists and is current
+        ActionListenerBeanDef a = findByJsfidImpl(
+                owner, actionListener.getJsfid());
+
+        // ActionListener doesn't already exist; fixup ownership
+        if (a == null) {
+            a = actionListener;
+            a.setOwnerId(owner.getId());
+            a.setOwnershipType(owner.getType());
+        } else {
+            a.setJsfid(actionListener.getJsfid());
+            a.setDescription(actionListener.getDescription());
+        }
+
+        em.persist(a);
+
+        persistSymbolsAttributes(a, children);
+
+        return a;
+    }
+
+    private ActionListenerBeanDef findByJsfidImpl(
+            AbstractComponentBeanDef owner, String jsfid) {
+        EntityManager em = getEntityManager();
+        ActionListenerBeanDef actionListener = null;
+        try {
+            actionListener = (ActionListenerBeanDef) em.createNamedQuery(
+                    "findActionListenerByJsfid").setParameter("ownerId",
+                    owner.getId()).setParameter("ownershipType",
+                    owner.getType()).setParameter("jsfid", jsfid)
+                    .getSingleResult();
+
+        } catch (NoResultException e) {
+            actionListener = null;
+        }
+        return actionListener;
+    }
+
+
+    public List<AttributeBeanDef> findAttributes(ActionListenerBeanDef owner) {
+        return super.findAttributes(owner);
+    }
+
+    public List<SymbolBeanDef> findSymbols(ActionListenerBeanDef owner) {
+        return super.findSymbols(owner);
+    }
+
+    
+    private List<ActionListenerBeanDef> findAllImpl(
+            AbstractComponentBeanDef owner) {
+        EntityManager em = getEntityManager();
+        List<ActionListenerBeanDef> children = null;
+
+        children = em.createNamedQuery(
+                "findActionListeners").setParameter("ownerId", owner.getId())
+                .setParameter("ownershipType", owner.getType()).getResultList();
+
+        return children;
+    }
+
+    public List<ActionListenerBeanDef> findAll(ComponentBeanDef owner) {
+        return findAllImpl(owner);
+    }
+
+    public List<ActionListenerBeanDef> findAll(ElementBeanDef owner) {
+        return findAllImpl(owner);
+    }
+
+    
+    
+}

Propchange: shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ActionListenerConfigBeanFacadeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ComponentConfigBeanFacadeImpl.java
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ComponentConfigBeanFacadeImpl.java?view=diff&rev=443457&r1=443456&r2=443457
==============================================================================
--- shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ComponentConfigBeanFacadeImpl.java (original)
+++ shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ComponentConfigBeanFacadeImpl.java Thu Sep 14 13:22:18 2006
@@ -1,79 +1,79 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shale.clay.configjpa.services.impl;
-
-import java.io.Serializable;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.NoResultException;
-
-import org.apache.shale.clay.configjpa.beans.AttributeBeanDef;
-import org.apache.shale.clay.configjpa.beans.ComponentBeanDef;
-import org.apache.shale.clay.configjpa.beans.SymbolBeanDef;
-import org.apache.shale.clay.configjpa.services.ComponentConfigBeanFacade;
-
-public class ComponentConfigBeanFacadeImpl extends AbstractFacade implements
-        Serializable, ComponentConfigBeanFacade {
-
-    private static final long serialVersionUID = 1141325096878126768L;
-
-    public ComponentBeanDef persist(ComponentBeanDef component, List... children) {
-        EntityManager em = getEntityManager();
-        ComponentBeanDef c = findByJsfid(component.getJsfid());;
-        if (c == null) {
-            c = component;    
-        } else {
-            c.setAllowBody(component.getAllowBody());
-            c.setComponentType(component.getComponentType());
-            c.setDescription(component.getDescription());
-            c.setExtendsJsfid(c.getExtendsJsfid());
-            c.setFacetName(component.getFacetName());
-        }
-        
-        em.persist(c);
-        
-        persistSymbolsAttributes(c, children);
-        
-        return c;
-    }
-
-
-    public ComponentBeanDef findByJsfid(String jsfid) {
-        EntityManager em = getEntityManager();
-        ComponentBeanDef component = null;
-        try {
-            component = (ComponentBeanDef) em.createNamedQuery(
-                    "findComponentByJsfid").setParameter("jsfid", jsfid)
-                    .getSingleResult();
-        } catch (NoResultException e) {
-            component = null;
-        }
-        return component;
-    }
-
-    
-    
-    public List<AttributeBeanDef> findAttributes(ComponentBeanDef owner) {
-        return super.findAttributes(owner);    
-     }
-     
-     public List<SymbolBeanDef> findSymbols(ComponentBeanDef owner) {
-        return super.findSymbols(owner);    
-     }
-
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shale.clay.configjpa.services.impl;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+
+import org.apache.shale.clay.configjpa.beans.AttributeBeanDef;
+import org.apache.shale.clay.configjpa.beans.ComponentBeanDef;
+import org.apache.shale.clay.configjpa.beans.SymbolBeanDef;
+import org.apache.shale.clay.configjpa.services.ComponentConfigBeanFacade;
+
+public class ComponentConfigBeanFacadeImpl extends AbstractFacade implements
+        Serializable, ComponentConfigBeanFacade {
+
+    private static final long serialVersionUID = 1141325096878126768L;
+
+    public ComponentBeanDef persist(ComponentBeanDef component, List... children) {
+        EntityManager em = getEntityManager();
+        ComponentBeanDef c = findByJsfid(component.getJsfid());;
+        if (c == null) {
+            c = component;    
+        } else {
+            c.setAllowBody(component.getAllowBody());
+            c.setComponentType(component.getComponentType());
+            c.setDescription(component.getDescription());
+            c.setExtendsJsfid(c.getExtendsJsfid());
+            c.setFacetName(component.getFacetName());
+        }
+        
+        em.persist(c);
+        
+        persistSymbolsAttributes(c, children);
+        
+        return c;
+    }
+
+
+    public ComponentBeanDef findByJsfid(String jsfid) {
+        EntityManager em = getEntityManager();
+        ComponentBeanDef component = null;
+        try {
+            component = (ComponentBeanDef) em.createNamedQuery(
+                    "findComponentByJsfid").setParameter("jsfid", jsfid)
+                    .getSingleResult();
+        } catch (NoResultException e) {
+            component = null;
+        }
+        return component;
+    }
+
+    
+    
+    public List<AttributeBeanDef> findAttributes(ComponentBeanDef owner) {
+        return super.findAttributes(owner);    
+     }
+     
+     public List<SymbolBeanDef> findSymbols(ComponentBeanDef owner) {
+        return super.findSymbols(owner);    
+     }
+
+}

Propchange: shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ComponentConfigBeanFacadeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ConverterConfigBeanFacadeImpl.java
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ConverterConfigBeanFacadeImpl.java?view=diff&rev=443457&r1=443456&r2=443457
==============================================================================
--- shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ConverterConfigBeanFacadeImpl.java (original)
+++ shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ConverterConfigBeanFacadeImpl.java Thu Sep 14 13:22:18 2006
@@ -1,123 +1,123 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shale.clay.configjpa.services.impl;
-
-import java.io.Serializable;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.NoResultException;
-
-import org.apache.shale.clay.configjpa.beans.AbstractComponentBeanDef;
-import org.apache.shale.clay.configjpa.beans.AttributeBeanDef;
-import org.apache.shale.clay.configjpa.beans.ComponentBeanDef;
-import org.apache.shale.clay.configjpa.beans.ConverterBeanDef;
-import org.apache.shale.clay.configjpa.beans.ElementBeanDef;
-import org.apache.shale.clay.configjpa.beans.SymbolBeanDef;
-import org.apache.shale.clay.configjpa.services.ConverterConfigBeanFacade;
-
-public class ConverterConfigBeanFacadeImpl extends AbstractFacade implements
-        Serializable, ConverterConfigBeanFacade {
-    
-    private static final long serialVersionUID = 819147425988603593L;
-
-    public AbstractComponentBeanDef persist(ComponentBeanDef owner, ConverterBeanDef Converter, List... children) {
-        return persistImpl(owner, Converter, children);      
-    }
-    
-    public ConverterBeanDef findByJsfid(ComponentBeanDef owner, String jsfid) {
-       return findByJsfidImpl(owner, jsfid);        
-    }
-
-    public AbstractComponentBeanDef persist(ElementBeanDef owner, ConverterBeanDef Converter, List... children) {
-        return persistImpl(owner, Converter, children);              
-    }
-    
-    public ConverterBeanDef findByJsfid(ElementBeanDef owner, String jsfid) {
-        return findByJsfidImpl(owner, jsfid);                
-    }
-    
-    
-    
-    private AbstractComponentBeanDef persistImpl(AbstractComponentBeanDef owner, ConverterBeanDef converter, List[] children) {
-        EntityManager em = getEntityManager();
-        
-        // make sure the component exists and is current
-        ConverterBeanDef c = findByJsfidImpl(owner, converter.getJsfid());
-              
-        // Converter doesn't already exist; fixup ownership
-        if (c == null) {
-            c = converter;
-            c.setOwnerId(owner.getId());
-            c.setOwnershipType(owner.getType());
-        } else {
-            c.setJsfid(converter.getJsfid());
-            c.setDescription(converter.getDescription());
-        }
-
-        em.persist(c);        
-        persistSymbolsAttributes(c, children);
-        return c;
-    }
-
-    
-    
-    private ConverterBeanDef findByJsfidImpl(AbstractComponentBeanDef owner, String jsfid) {
-        EntityManager em = getEntityManager();
-        ConverterBeanDef converter = null;
-        try {
-            converter = (ConverterBeanDef) em.createNamedQuery("findConverterByJsfid")
-                           .setParameter("ownerId", owner.getId())
-                           .setParameter("ownershipType", owner.getType())
-                           .setParameter("jsfid", jsfid).getSingleResult();
-                        
-        } catch (NoResultException e) {
-            converter = null;
-        }
-        return converter;
-    }
-
-   
-    public List<AttributeBeanDef> findAttributes(ConverterBeanDef owner) {
-       return super.findAttributes(owner);    
-    }
-    
-    public List<SymbolBeanDef> findSymbols(ConverterBeanDef owner) {
-       return super.findSymbols(owner);    
-    }
-
-    
-    private List<ConverterBeanDef> findAllImpl(AbstractComponentBeanDef owner) {
-        EntityManager em = getEntityManager();
-        List<ConverterBeanDef> children = null;
-
-        children = em.createNamedQuery(
-                "findConverters").setParameter("ownerId", owner.getId())
-                .setParameter("ownershipType", owner.getType()).getResultList();
-
-        return children;
-    }
-
-    public List<ConverterBeanDef> findAll(ComponentBeanDef owner) {
-        return findAllImpl(owner);
-    }
-
-    public List<ConverterBeanDef> findAll(ElementBeanDef owner) {
-        return findAllImpl(owner);
-    }
-    
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shale.clay.configjpa.services.impl;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+
+import org.apache.shale.clay.configjpa.beans.AbstractComponentBeanDef;
+import org.apache.shale.clay.configjpa.beans.AttributeBeanDef;
+import org.apache.shale.clay.configjpa.beans.ComponentBeanDef;
+import org.apache.shale.clay.configjpa.beans.ConverterBeanDef;
+import org.apache.shale.clay.configjpa.beans.ElementBeanDef;
+import org.apache.shale.clay.configjpa.beans.SymbolBeanDef;
+import org.apache.shale.clay.configjpa.services.ConverterConfigBeanFacade;
+
+public class ConverterConfigBeanFacadeImpl extends AbstractFacade implements
+        Serializable, ConverterConfigBeanFacade {
+    
+    private static final long serialVersionUID = 819147425988603593L;
+
+    public AbstractComponentBeanDef persist(ComponentBeanDef owner, ConverterBeanDef Converter, List... children) {
+        return persistImpl(owner, Converter, children);      
+    }
+    
+    public ConverterBeanDef findByJsfid(ComponentBeanDef owner, String jsfid) {
+       return findByJsfidImpl(owner, jsfid);        
+    }
+
+    public AbstractComponentBeanDef persist(ElementBeanDef owner, ConverterBeanDef Converter, List... children) {
+        return persistImpl(owner, Converter, children);              
+    }
+    
+    public ConverterBeanDef findByJsfid(ElementBeanDef owner, String jsfid) {
+        return findByJsfidImpl(owner, jsfid);                
+    }
+    
+    
+    
+    private AbstractComponentBeanDef persistImpl(AbstractComponentBeanDef owner, ConverterBeanDef converter, List[] children) {
+        EntityManager em = getEntityManager();
+        
+        // make sure the component exists and is current
+        ConverterBeanDef c = findByJsfidImpl(owner, converter.getJsfid());
+              
+        // Converter doesn't already exist; fixup ownership
+        if (c == null) {
+            c = converter;
+            c.setOwnerId(owner.getId());
+            c.setOwnershipType(owner.getType());
+        } else {
+            c.setJsfid(converter.getJsfid());
+            c.setDescription(converter.getDescription());
+        }
+
+        em.persist(c);        
+        persistSymbolsAttributes(c, children);
+        return c;
+    }
+
+    
+    
+    private ConverterBeanDef findByJsfidImpl(AbstractComponentBeanDef owner, String jsfid) {
+        EntityManager em = getEntityManager();
+        ConverterBeanDef converter = null;
+        try {
+            converter = (ConverterBeanDef) em.createNamedQuery("findConverterByJsfid")
+                           .setParameter("ownerId", owner.getId())
+                           .setParameter("ownershipType", owner.getType())
+                           .setParameter("jsfid", jsfid).getSingleResult();
+                        
+        } catch (NoResultException e) {
+            converter = null;
+        }
+        return converter;
+    }
+
+   
+    public List<AttributeBeanDef> findAttributes(ConverterBeanDef owner) {
+       return super.findAttributes(owner);    
+    }
+    
+    public List<SymbolBeanDef> findSymbols(ConverterBeanDef owner) {
+       return super.findSymbols(owner);    
+    }
+
+    
+    private List<ConverterBeanDef> findAllImpl(AbstractComponentBeanDef owner) {
+        EntityManager em = getEntityManager();
+        List<ConverterBeanDef> children = null;
+
+        children = em.createNamedQuery(
+                "findConverters").setParameter("ownerId", owner.getId())
+                .setParameter("ownershipType", owner.getType()).getResultList();
+
+        return children;
+    }
+
+    public List<ConverterBeanDef> findAll(ComponentBeanDef owner) {
+        return findAllImpl(owner);
+    }
+
+    public List<ConverterBeanDef> findAll(ElementBeanDef owner) {
+        return findAllImpl(owner);
+    }
+    
+}

Propchange: shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ConverterConfigBeanFacadeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ElementConfigBeanFacadeImpl.java
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ElementConfigBeanFacadeImpl.java?view=diff&rev=443457&r1=443456&r2=443457
==============================================================================
--- shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ElementConfigBeanFacadeImpl.java (original)
+++ shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ElementConfigBeanFacadeImpl.java Thu Sep 14 13:22:18 2006
@@ -1,127 +1,127 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shale.clay.configjpa.services.impl;
-
-import java.io.Serializable;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.NoResultException;
-
-import org.apache.shale.clay.configjpa.beans.AbstractComponentBeanDef;
-import org.apache.shale.clay.configjpa.beans.AttributeBeanDef;
-import org.apache.shale.clay.configjpa.beans.ComponentBeanDef;
-import org.apache.shale.clay.configjpa.beans.ElementBeanDef;
-import org.apache.shale.clay.configjpa.beans.SymbolBeanDef;
-import org.apache.shale.clay.configjpa.services.ElementConfigBeanFacade;
-
-public class ElementConfigBeanFacadeImpl extends AbstractFacade implements
-        Serializable, ElementConfigBeanFacade {
-    
-    
-    private static final long serialVersionUID = -7582880061907015452L;
-
-    public AbstractComponentBeanDef persist(ComponentBeanDef owner, ElementBeanDef element, List... children) {
-        return persistImpl(owner, element, children);      
-    }
-    
-    public ElementBeanDef findByRenderId(ComponentBeanDef owner, int renderId) {
-       return findByRenderIdImpl(owner, renderId);        
-    }
-
-    public AbstractComponentBeanDef persist(ElementBeanDef owner, ElementBeanDef element, List... children) {
-        return persistImpl(owner, element, children);              
-    }
-    
-    public ElementBeanDef findByRenderId(ElementBeanDef owner, int renderId) {
-        return findByRenderIdImpl(owner, renderId);                
-    }
-    
-    
-    
-    private AbstractComponentBeanDef persistImpl(AbstractComponentBeanDef owner, ElementBeanDef element, List[] children) {
-        EntityManager em = getEntityManager();
-        
-        // make sure the component exists and is current
-        ElementBeanDef e = findByRenderIdImpl(owner, element.getRenderId());
-              
-        // Element doesn't already exist; fixup ownership
-        if (e == null) {
-            e = element;
-            e.setOwnerId(owner.getId());
-            e.setOwnershipType(owner.getType());
-        } else {
-            e.setJsfid(element.getJsfid());
-            e.setDescription(element.getDescription());
-        }
-
-        em.persist(e);
-        
-        persistSymbolsAttributes(e, children);
-
-        
-        return e;
-    }
-
-    
-    
-    private ElementBeanDef findByRenderIdImpl(AbstractComponentBeanDef owner, int renderId) {
-        EntityManager em = getEntityManager();
-        ElementBeanDef element = null;
-        try {
-            element = (ElementBeanDef) em.createNamedQuery("findElementByRenderId")
-                           .setParameter("ownerId", owner.getId())
-                           .setParameter("ownershipType", owner.getType())
-                           .setParameter("renderId", renderId).getSingleResult();
-                        
-        } catch (NoResultException e) {
-            element = null;
-        }
-        return element;
-    }
-
-   
-    public List<AttributeBeanDef> findAttributes(ElementBeanDef owner) {
-       return super.findAttributes(owner);    
-    }
-    
-    public List<SymbolBeanDef> findSymbols(ElementBeanDef owner) {
-       return super.findSymbols(owner);    
-    }
-
-    private List<ElementBeanDef> findAllImpl(AbstractComponentBeanDef owner) {
-        EntityManager em = getEntityManager();
-        List<ElementBeanDef> children = null;
-
-        children = em.createNamedQuery("findElements")
-                .setParameter("ownerId", owner.getId()).setParameter(
-                        "ownershipType", owner.getType()).getResultList();
-
-        return children;
-    }
-
-    public List<ElementBeanDef> findAll(ComponentBeanDef owner) {
-        return findAllImpl(owner);
-    }
-
-    public List<ElementBeanDef> findAll(ElementBeanDef owner) {
-        return findAllImpl(owner);
-    }
-    
-    
-    
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shale.clay.configjpa.services.impl;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+
+import org.apache.shale.clay.configjpa.beans.AbstractComponentBeanDef;
+import org.apache.shale.clay.configjpa.beans.AttributeBeanDef;
+import org.apache.shale.clay.configjpa.beans.ComponentBeanDef;
+import org.apache.shale.clay.configjpa.beans.ElementBeanDef;
+import org.apache.shale.clay.configjpa.beans.SymbolBeanDef;
+import org.apache.shale.clay.configjpa.services.ElementConfigBeanFacade;
+
+public class ElementConfigBeanFacadeImpl extends AbstractFacade implements
+        Serializable, ElementConfigBeanFacade {
+    
+    
+    private static final long serialVersionUID = -7582880061907015452L;
+
+    public AbstractComponentBeanDef persist(ComponentBeanDef owner, ElementBeanDef element, List... children) {
+        return persistImpl(owner, element, children);      
+    }
+    
+    public ElementBeanDef findByRenderId(ComponentBeanDef owner, int renderId) {
+       return findByRenderIdImpl(owner, renderId);        
+    }
+
+    public AbstractComponentBeanDef persist(ElementBeanDef owner, ElementBeanDef element, List... children) {
+        return persistImpl(owner, element, children);              
+    }
+    
+    public ElementBeanDef findByRenderId(ElementBeanDef owner, int renderId) {
+        return findByRenderIdImpl(owner, renderId);                
+    }
+    
+    
+    
+    private AbstractComponentBeanDef persistImpl(AbstractComponentBeanDef owner, ElementBeanDef element, List[] children) {
+        EntityManager em = getEntityManager();
+        
+        // make sure the component exists and is current
+        ElementBeanDef e = findByRenderIdImpl(owner, element.getRenderId());
+              
+        // Element doesn't already exist; fixup ownership
+        if (e == null) {
+            e = element;
+            e.setOwnerId(owner.getId());
+            e.setOwnershipType(owner.getType());
+        } else {
+            e.setJsfid(element.getJsfid());
+            e.setDescription(element.getDescription());
+        }
+
+        em.persist(e);
+        
+        persistSymbolsAttributes(e, children);
+
+        
+        return e;
+    }
+
+    
+    
+    private ElementBeanDef findByRenderIdImpl(AbstractComponentBeanDef owner, int renderId) {
+        EntityManager em = getEntityManager();
+        ElementBeanDef element = null;
+        try {
+            element = (ElementBeanDef) em.createNamedQuery("findElementByRenderId")
+                           .setParameter("ownerId", owner.getId())
+                           .setParameter("ownershipType", owner.getType())
+                           .setParameter("renderId", renderId).getSingleResult();
+                        
+        } catch (NoResultException e) {
+            element = null;
+        }
+        return element;
+    }
+
+   
+    public List<AttributeBeanDef> findAttributes(ElementBeanDef owner) {
+       return super.findAttributes(owner);    
+    }
+    
+    public List<SymbolBeanDef> findSymbols(ElementBeanDef owner) {
+       return super.findSymbols(owner);    
+    }
+
+    private List<ElementBeanDef> findAllImpl(AbstractComponentBeanDef owner) {
+        EntityManager em = getEntityManager();
+        List<ElementBeanDef> children = null;
+
+        children = em.createNamedQuery("findElements")
+                .setParameter("ownerId", owner.getId()).setParameter(
+                        "ownershipType", owner.getType()).getResultList();
+
+        return children;
+    }
+
+    public List<ElementBeanDef> findAll(ComponentBeanDef owner) {
+        return findAllImpl(owner);
+    }
+
+    public List<ElementBeanDef> findAll(ElementBeanDef owner) {
+        return findAllImpl(owner);
+    }
+    
+    
+    
+}

Propchange: shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ElementConfigBeanFacadeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ValidatorConfigBeanFacadeImpl.java
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ValidatorConfigBeanFacadeImpl.java?view=diff&rev=443457&r1=443456&r2=443457
==============================================================================
--- shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ValidatorConfigBeanFacadeImpl.java (original)
+++ shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ValidatorConfigBeanFacadeImpl.java Thu Sep 14 13:22:18 2006
@@ -1,125 +1,125 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shale.clay.configjpa.services.impl;
-
-import java.io.Serializable;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.NoResultException;
-
-import org.apache.shale.clay.configjpa.beans.AbstractComponentBeanDef;
-import org.apache.shale.clay.configjpa.beans.AttributeBeanDef;
-import org.apache.shale.clay.configjpa.beans.ComponentBeanDef;
-import org.apache.shale.clay.configjpa.beans.ElementBeanDef;
-import org.apache.shale.clay.configjpa.beans.SymbolBeanDef;
-import org.apache.shale.clay.configjpa.beans.ValidatorBeanDef;
-import org.apache.shale.clay.configjpa.services.ValidatorConfigBeanFacade;
-
-public class ValidatorConfigBeanFacadeImpl extends AbstractFacade implements
-        Serializable, ValidatorConfigBeanFacade {
-
-    private static final long serialVersionUID = -8723587340114834735L;
-
-    public AbstractComponentBeanDef persist(ComponentBeanDef owner,
-            ValidatorBeanDef validator, List... children) {
-        return persistImpl(owner, validator, children);
-    }
-
-    public ValidatorBeanDef findByJsfid(ComponentBeanDef owner, String jsfid) {
-        return findByJsfidImpl(owner, jsfid);
-    }
-
-    public AbstractComponentBeanDef persist(ElementBeanDef owner,
-            ValidatorBeanDef validator, List... children) {
-        return persistImpl(owner, validator, children);
-    }
-
-    public ValidatorBeanDef findByJsfid(ElementBeanDef owner, String jsfid) {
-        return findByJsfidImpl(owner, jsfid);
-    }
-
-    private AbstractComponentBeanDef persistImpl(
-            AbstractComponentBeanDef owner, ValidatorBeanDef validator,
-            List[] children) {
-        EntityManager em = getEntityManager();
-
-        // make sure the component exists and is current
-        ValidatorBeanDef v = findByJsfidImpl(owner,
-                validator.getJsfid());
-
-        // validator doesn't already exist; fixup ownership to a component
-        if (v == null) {
-            v = validator;
-            v.setOwnerId(owner.getId());
-            v.setOwnershipType(owner.getType());
-        } else {
-            v.setJsfid(validator.getJsfid());
-            v.setDescription(validator.getDescription());
-        }
-
-        em.persist(v);
-        persistSymbolsAttributes(v, children);
-
-        return v;
-    }
-
-    private ValidatorBeanDef findByJsfidImpl(AbstractComponentBeanDef owner,
-            String jsfid) {
-        EntityManager em = getEntityManager();
-        ValidatorBeanDef validator = null;
-        try {
-            validator = (ValidatorBeanDef) em.createNamedQuery(
-                    "findValidatorByJsfid").setParameter("ownerId",
-                    owner.getId()).setParameter("ownershipType",
-                    owner.getType()).setParameter("jsfid", jsfid)
-                    .getSingleResult();
-
-        } catch (NoResultException e) {
-            validator = null;
-        }
-        return validator;
-    }
-
-    public List<AttributeBeanDef> findAttributes(ValidatorBeanDef owner) {
-        return super.findAttributes(owner);
-    }
-
-    public List<SymbolBeanDef> findSymbols(ValidatorBeanDef owner) {
-        return super.findSymbols(owner);
-    }
-
-    private List<ValidatorBeanDef> findAllImpl(AbstractComponentBeanDef owner) {
-        EntityManager em = getEntityManager();
-        List<ValidatorBeanDef> children = null;
-
-        children = em.createNamedQuery(
-                "findValidators").setParameter("ownerId", owner.getId())
-                .setParameter("ownershipType", owner.getType()).getResultList();
-
-        return children;
-    }
-
-    public List<ValidatorBeanDef> findAll(ComponentBeanDef owner) {
-        return findAllImpl(owner);
-    }
-
-    public List<ValidatorBeanDef> findAll(ElementBeanDef owner) {
-        return findAllImpl(owner);
-    }
-
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shale.clay.configjpa.services.impl;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+
+import org.apache.shale.clay.configjpa.beans.AbstractComponentBeanDef;
+import org.apache.shale.clay.configjpa.beans.AttributeBeanDef;
+import org.apache.shale.clay.configjpa.beans.ComponentBeanDef;
+import org.apache.shale.clay.configjpa.beans.ElementBeanDef;
+import org.apache.shale.clay.configjpa.beans.SymbolBeanDef;
+import org.apache.shale.clay.configjpa.beans.ValidatorBeanDef;
+import org.apache.shale.clay.configjpa.services.ValidatorConfigBeanFacade;
+
+public class ValidatorConfigBeanFacadeImpl extends AbstractFacade implements
+        Serializable, ValidatorConfigBeanFacade {
+
+    private static final long serialVersionUID = -8723587340114834735L;
+
+    public AbstractComponentBeanDef persist(ComponentBeanDef owner,
+            ValidatorBeanDef validator, List... children) {
+        return persistImpl(owner, validator, children);
+    }
+
+    public ValidatorBeanDef findByJsfid(ComponentBeanDef owner, String jsfid) {
+        return findByJsfidImpl(owner, jsfid);
+    }
+
+    public AbstractComponentBeanDef persist(ElementBeanDef owner,
+            ValidatorBeanDef validator, List... children) {
+        return persistImpl(owner, validator, children);
+    }
+
+    public ValidatorBeanDef findByJsfid(ElementBeanDef owner, String jsfid) {
+        return findByJsfidImpl(owner, jsfid);
+    }
+
+    private AbstractComponentBeanDef persistImpl(
+            AbstractComponentBeanDef owner, ValidatorBeanDef validator,
+            List[] children) {
+        EntityManager em = getEntityManager();
+
+        // make sure the component exists and is current
+        ValidatorBeanDef v = findByJsfidImpl(owner,
+                validator.getJsfid());
+
+        // validator doesn't already exist; fixup ownership to a component
+        if (v == null) {
+            v = validator;
+            v.setOwnerId(owner.getId());
+            v.setOwnershipType(owner.getType());
+        } else {
+            v.setJsfid(validator.getJsfid());
+            v.setDescription(validator.getDescription());
+        }
+
+        em.persist(v);
+        persistSymbolsAttributes(v, children);
+
+        return v;
+    }
+
+    private ValidatorBeanDef findByJsfidImpl(AbstractComponentBeanDef owner,
+            String jsfid) {
+        EntityManager em = getEntityManager();
+        ValidatorBeanDef validator = null;
+        try {
+            validator = (ValidatorBeanDef) em.createNamedQuery(
+                    "findValidatorByJsfid").setParameter("ownerId",
+                    owner.getId()).setParameter("ownershipType",
+                    owner.getType()).setParameter("jsfid", jsfid)
+                    .getSingleResult();
+
+        } catch (NoResultException e) {
+            validator = null;
+        }
+        return validator;
+    }
+
+    public List<AttributeBeanDef> findAttributes(ValidatorBeanDef owner) {
+        return super.findAttributes(owner);
+    }
+
+    public List<SymbolBeanDef> findSymbols(ValidatorBeanDef owner) {
+        return super.findSymbols(owner);
+    }
+
+    private List<ValidatorBeanDef> findAllImpl(AbstractComponentBeanDef owner) {
+        EntityManager em = getEntityManager();
+        List<ValidatorBeanDef> children = null;
+
+        children = em.createNamedQuery(
+                "findValidators").setParameter("ownerId", owner.getId())
+                .setParameter("ownershipType", owner.getType()).getResultList();
+
+        return children;
+    }
+
+    public List<ValidatorBeanDef> findAll(ComponentBeanDef owner) {
+        return findAllImpl(owner);
+    }
+
+    public List<ValidatorBeanDef> findAll(ElementBeanDef owner) {
+        return findAllImpl(owner);
+    }
+
+}

Propchange: shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ValidatorConfigBeanFacadeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ValueChangeListenerConfigBeanFacadeImpl.java
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ValueChangeListenerConfigBeanFacadeImpl.java?view=diff&rev=443457&r1=443456&r2=443457
==============================================================================
--- shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ValueChangeListenerConfigBeanFacadeImpl.java (original)
+++ shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ValueChangeListenerConfigBeanFacadeImpl.java Thu Sep 14 13:22:18 2006
@@ -1,133 +1,133 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shale.clay.configjpa.services.impl;
-
-import java.io.Serializable;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.NoResultException;
-
-import org.apache.shale.clay.configjpa.beans.AbstractComponentBeanDef;
-import org.apache.shale.clay.configjpa.beans.AttributeBeanDef;
-import org.apache.shale.clay.configjpa.beans.ComponentBeanDef;
-import org.apache.shale.clay.configjpa.beans.ElementBeanDef;
-import org.apache.shale.clay.configjpa.beans.SymbolBeanDef;
-import org.apache.shale.clay.configjpa.beans.ValueChangeListenerBeanDef;
-import org.apache.shale.clay.configjpa.services.ValueChangeListenerConfigBeanFacade;
-
-public class ValueChangeListenerConfigBeanFacadeImpl extends AbstractFacade
-        implements Serializable, ValueChangeListenerConfigBeanFacade {
-
-    private static final long serialVersionUID = -6762096811985835447L;
-
-    public AbstractComponentBeanDef persist(ComponentBeanDef owner,
-            ValueChangeListenerBeanDef ValueChangeListener, List... children) {
-        return persistImpl(owner, ValueChangeListener, children);
-    }
-
-    public ValueChangeListenerBeanDef findByJsfid(ComponentBeanDef owner,
-            String jsfid) {
-        return findByJsfidImpl(owner, jsfid);
-    }
-
-    public AbstractComponentBeanDef persist(ElementBeanDef owner,
-            ValueChangeListenerBeanDef ValueChangeListener, List... children) {
-        return persistImpl(owner, ValueChangeListener, children);
-    }
-
-    public ValueChangeListenerBeanDef findByJsfid(ElementBeanDef owner,
-            String jsfid) {
-        return findByJsfidImpl(owner, jsfid);
-    }
-
-    private AbstractComponentBeanDef persistImpl(
-            AbstractComponentBeanDef owner,
-            ValueChangeListenerBeanDef valueChangeListener, List[] children) {
-        EntityManager em = getEntityManager();
-
-        // make sure the component exists and is current
-        ValueChangeListenerBeanDef v = findByJsfidImpl(
-                owner, valueChangeListener
-                        .getJsfid());
-
-        // ValueChangeListener doesn't already exist; fixup ownership
-        // component
-        if (v == null) {
-            v = valueChangeListener;
-            v.setOwnerId(owner.getId());
-            v.setOwnershipType(owner.getType());
-        } else {
-            v.setJsfid(valueChangeListener.getJsfid());
-            v.setDescription(valueChangeListener.getDescription());
-        }
-
-        em.persist(v);
-
-        persistSymbolsAttributes(valueChangeListener, children);
-
-        return v;
-    }
-
-    private ValueChangeListenerBeanDef findByJsfidImpl(
-            AbstractComponentBeanDef owner, String jsfid) {
-        EntityManager em = getEntityManager();
-        ValueChangeListenerBeanDef ValueChangeListener = null;
-        try {
-            ValueChangeListener = (ValueChangeListenerBeanDef) em
-                    .createNamedQuery("findValueChangeListenerByJsfid")
-                    .setParameter("ownerId", owner.getId()).setParameter(
-                            "ownershipType", owner.getType()).setParameter(
-                            "jsfid", jsfid).getSingleResult();
-
-        } catch (NoResultException e) {
-            ValueChangeListener = null;
-        }
-        return ValueChangeListener;
-    }
-
-    public List<AttributeBeanDef> findAttributes(
-            ValueChangeListenerBeanDef owner) {
-        return super.findAttributes(owner);
-    }
-
-    public List<SymbolBeanDef> findSymbols(ValueChangeListenerBeanDef owner) {
-        return super.findSymbols(owner);
-    }
-
-    private List<ValueChangeListenerBeanDef> findAllImpl(
-            AbstractComponentBeanDef owner) {
-        EntityManager em = getEntityManager();
-        List<ValueChangeListenerBeanDef> children = null;
-
-        children = em.createNamedQuery(
-                "findValueChangeListerns").setParameter("ownerId",
-                owner.getId()).setParameter("ownershipType", owner.getType())
-                .getResultList();
-
-        return children;
-    }
-
-    public List<ValueChangeListenerBeanDef> findAll(ComponentBeanDef owner) {
-        return findAllImpl(owner);
-    }
-
-    public List<ValueChangeListenerBeanDef> findAll(ElementBeanDef owner) {
-        return findAllImpl(owner);
-    }
-
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shale.clay.configjpa.services.impl;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+
+import org.apache.shale.clay.configjpa.beans.AbstractComponentBeanDef;
+import org.apache.shale.clay.configjpa.beans.AttributeBeanDef;
+import org.apache.shale.clay.configjpa.beans.ComponentBeanDef;
+import org.apache.shale.clay.configjpa.beans.ElementBeanDef;
+import org.apache.shale.clay.configjpa.beans.SymbolBeanDef;
+import org.apache.shale.clay.configjpa.beans.ValueChangeListenerBeanDef;
+import org.apache.shale.clay.configjpa.services.ValueChangeListenerConfigBeanFacade;
+
+public class ValueChangeListenerConfigBeanFacadeImpl extends AbstractFacade
+        implements Serializable, ValueChangeListenerConfigBeanFacade {
+
+    private static final long serialVersionUID = -6762096811985835447L;
+
+    public AbstractComponentBeanDef persist(ComponentBeanDef owner,
+            ValueChangeListenerBeanDef ValueChangeListener, List... children) {
+        return persistImpl(owner, ValueChangeListener, children);
+    }
+
+    public ValueChangeListenerBeanDef findByJsfid(ComponentBeanDef owner,
+            String jsfid) {
+        return findByJsfidImpl(owner, jsfid);
+    }
+
+    public AbstractComponentBeanDef persist(ElementBeanDef owner,
+            ValueChangeListenerBeanDef ValueChangeListener, List... children) {
+        return persistImpl(owner, ValueChangeListener, children);
+    }
+
+    public ValueChangeListenerBeanDef findByJsfid(ElementBeanDef owner,
+            String jsfid) {
+        return findByJsfidImpl(owner, jsfid);
+    }
+
+    private AbstractComponentBeanDef persistImpl(
+            AbstractComponentBeanDef owner,
+            ValueChangeListenerBeanDef valueChangeListener, List[] children) {
+        EntityManager em = getEntityManager();
+
+        // make sure the component exists and is current
+        ValueChangeListenerBeanDef v = findByJsfidImpl(
+                owner, valueChangeListener
+                        .getJsfid());
+
+        // ValueChangeListener doesn't already exist; fixup ownership
+        // component
+        if (v == null) {
+            v = valueChangeListener;
+            v.setOwnerId(owner.getId());
+            v.setOwnershipType(owner.getType());
+        } else {
+            v.setJsfid(valueChangeListener.getJsfid());
+            v.setDescription(valueChangeListener.getDescription());
+        }
+
+        em.persist(v);
+
+        persistSymbolsAttributes(valueChangeListener, children);
+
+        return v;
+    }
+
+    private ValueChangeListenerBeanDef findByJsfidImpl(
+            AbstractComponentBeanDef owner, String jsfid) {
+        EntityManager em = getEntityManager();
+        ValueChangeListenerBeanDef ValueChangeListener = null;
+        try {
+            ValueChangeListener = (ValueChangeListenerBeanDef) em
+                    .createNamedQuery("findValueChangeListenerByJsfid")
+                    .setParameter("ownerId", owner.getId()).setParameter(
+                            "ownershipType", owner.getType()).setParameter(
+                            "jsfid", jsfid).getSingleResult();
+
+        } catch (NoResultException e) {
+            ValueChangeListener = null;
+        }
+        return ValueChangeListener;
+    }
+
+    public List<AttributeBeanDef> findAttributes(
+            ValueChangeListenerBeanDef owner) {
+        return super.findAttributes(owner);
+    }
+
+    public List<SymbolBeanDef> findSymbols(ValueChangeListenerBeanDef owner) {
+        return super.findSymbols(owner);
+    }
+
+    private List<ValueChangeListenerBeanDef> findAllImpl(
+            AbstractComponentBeanDef owner) {
+        EntityManager em = getEntityManager();
+        List<ValueChangeListenerBeanDef> children = null;
+
+        children = em.createNamedQuery(
+                "findValueChangeListerns").setParameter("ownerId",
+                owner.getId()).setParameter("ownershipType", owner.getType())
+                .getResultList();
+
+        return children;
+    }
+
+    public List<ValueChangeListenerBeanDef> findAll(ComponentBeanDef owner) {
+        return findAllImpl(owner);
+    }
+
+    public List<ValueChangeListenerBeanDef> findAll(ElementBeanDef owner) {
+        return findAllImpl(owner);
+    }
+
+}

Propchange: shale/sandbox/shale-clay-jpa/src/main/java/org/apache/shale/clay/configjpa/services/impl/ValueChangeListenerConfigBeanFacadeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native