Index: dna-graph/src/main/java/org/jboss/dna/graph/connector/map/AbstractMapWorkspace.java =================================================================== --- dna-graph/src/main/java/org/jboss/dna/graph/connector/map/AbstractMapWorkspace.java (revision 1406) +++ dna-graph/src/main/java/org/jboss/dna/graph/connector/map/AbstractMapWorkspace.java (working copy) @@ -446,7 +446,48 @@ MapNode newParent, Name desiredName, boolean recursive ) { - return copyNode(context, original, newWorkspace, newParent, desiredName, true, new HashMap()); + + Map oldToNewUuids = new HashMap(); + MapNode copyRoot = copyNode(context, original, newWorkspace, newParent, desiredName, true, oldToNewUuids); + + // Now, adjust any references in the new subgraph to objects in the original subgraph + // (because they were internal references, and need to be internal to the new subgraph) + PropertyFactory propertyFactory = context.getPropertyFactory(); + UuidFactory uuidFactory = context.getValueFactories().getUuidFactory(); + ValueFactory referenceFactory = context.getValueFactories().getReferenceFactory(); + for (Map.Entry oldToNew : oldToNewUuids.entrySet()) { + MapNode oldNode = this.getNode(oldToNew.getKey()); + MapNode newNode = newWorkspace.getNode(oldToNew.getValue()); + assert oldNode != null; + assert newNode != null; + // Iterate over the properties of the new ... + for (Map.Entry entry : newNode.getProperties().entrySet()) { + Property property = entry.getValue(); + // Now see if any of the property values are references ... + List newValues = new ArrayList(); + boolean foundReference = false; + for (Iterator iter = property.getValues(); iter.hasNext();) { + Object value = iter.next(); + PropertyType type = PropertyType.discoverType(value); + if (type == PropertyType.REFERENCE) { + UUID oldReferencedUuid = uuidFactory.create(value); + UUID newReferencedUuid = oldToNewUuids.get(oldReferencedUuid); + if (newReferencedUuid != null) { + newValues.add(referenceFactory.create(newReferencedUuid)); + foundReference = true; + } + } else { + newValues.add(value); + } + } + // If we found at least one reference, we have to build a new Property object ... + if (foundReference) { + Property newProperty = propertyFactory.create(property.getName(), newValues); + entry.setValue(newProperty); + } + } + } + return copyRoot; } /** @@ -494,47 +535,6 @@ } } - if (!reuseUuids) { - assert oldToNewUuids != null; - // Now, adjust any references in the new subgraph to objects in the original subgraph - // (because they were internal references, and need to be internal to the new subgraph) - PropertyFactory propertyFactory = context.getPropertyFactory(); - UuidFactory uuidFactory = context.getValueFactories().getUuidFactory(); - ValueFactory referenceFactory = context.getValueFactories().getReferenceFactory(); - for (Map.Entry oldToNew : oldToNewUuids.entrySet()) { - MapNode oldNode = this.getNode(oldToNew.getKey()); - MapNode newNode = newWorkspace.getNode(oldToNew.getValue()); - assert oldNode != null; - assert newNode != null; - // Iterate over the properties of the new ... - for (Map.Entry entry : newNode.getProperties().entrySet()) { - Property property = entry.getValue(); - // Now see if any of the property values are references ... - List newValues = new ArrayList(); - boolean foundReference = false; - for (Iterator iter = property.getValues(); iter.hasNext();) { - Object value = iter.next(); - PropertyType type = PropertyType.discoverType(value); - if (type == PropertyType.REFERENCE) { - UUID oldReferencedUuid = uuidFactory.create(value); - UUID newReferencedUuid = oldToNewUuids.get(oldReferencedUuid); - if (newReferencedUuid != null) { - newValues.add(referenceFactory.create(newReferencedUuid)); - foundReference = true; - } - } else { - newValues.add(value); - } - } - // If we found at least one reference, we have to build a new Property object ... - if (foundReference) { - Property newProperty = propertyFactory.create(property.getName(), newValues); - entry.setValue(newProperty); - } - } - } - } - return copy; } Index: dna-graph/src/main/java/org/jboss/dna/graph/request/processor/LoggingRequestProcessor.java =================================================================== --- dna-graph/src/main/java/org/jboss/dna/graph/request/processor/LoggingRequestProcessor.java (revision 1406) +++ dna-graph/src/main/java/org/jboss/dna/graph/request/processor/LoggingRequestProcessor.java (working copy) @@ -452,7 +452,7 @@ public void close() { logger.log(level, GraphI18n.closingRequestProcessor); delegate.close(); - logger.log(level, GraphI18n.closingRequestProcessor); + logger.log(level, GraphI18n.closedRequestProcessor); } } Index: dna-integration-tests/src/test/java/org/jboss/dna/test/integration/SimpleJpaRepositoryTckTest.java =================================================================== --- dna-integration-tests/src/test/java/org/jboss/dna/test/integration/SimpleJpaRepositoryTckTest.java (revision 0) +++ dna-integration-tests/src/test/java/org/jboss/dna/test/integration/SimpleJpaRepositoryTckTest.java (revision 0) @@ -0,0 +1,32 @@ +/* + * JBoss DNA (http://www.jboss.org/dna) + * See the COPYRIGHT.txt file distributed with this work for information + * regarding copyright ownership. Some portions may be licensed + * to Red Hat, Inc. under one or more contributor license agreements. + * See the AUTHORS.txt file in the distribution for a full listing of + * individual contributors. + * + * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA + * is licensed to you 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. + * + * JBoss DNA 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.jboss.dna.test.integration; + +import junit.framework.Test; + +public class SimpleJpaRepositoryTckTest { + public static Test suite() { + return AbstractRepositoryTckTest.readWriteRepositorySuite("simple-jpa"); + } +} Property changes on: dna-integration-tests\src\test\java\org\jboss\dna\test\integration\SimpleJpaRepositoryTckTest.java ___________________________________________________________________ Added: svn:keywords + Id Revision Added: svn:eol-style + LF Index: dna-integration-tests/src/test/resources/log4j.properties =================================================================== --- dna-integration-tests/src/test/resources/log4j.properties (revision 1406) +++ dna-integration-tests/src/test/resources/log4j.properties (working copy) @@ -4,17 +4,37 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %m%n +# Direct log messages to a file +log4j.appender.file=org.apache.log4j.RollingFileAppender +log4j.appender.file.File=/tck.log +log4j.appender.file.layout=org.apache.log4j.PatternLayout +#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %m%n +log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} [%t] %m%n +#log4j.appender.file.layout.ConversionPattern=%5p [%c{1}] %m%n + # Root logger option -log4j.rootLogger=INFO, stdout +log4j.rootLogger=WARN, file # Set up the default logging to be INFO level, then override specific units -log4j.logger.org.jboss.dna=INFO +log4j.logger.org.jboss.dna=WARN log4j.logger.org.junit=DEBUG # log4j.logger.org.jboss.dna.tests.integration.jackrabbit.JackrabbitMySqlStressTest=DEBUG -log4j.logger.org.hibernate=WARN, stdout +log4j.logger.org.hibernate=WARN +log4j.logger.org.hibernate.pretty.Printer=WARN +log4j.logger.org.hibernate.engine.Collections=WARN +log4j.logger.org.hibernate.cfg=WARN +log4j.logger.org.hibernate.tool.hbm2ddl.SchemaExport=WARN +log4j.logger.org.hibernate.persister.entity.AbstractEntityPersister=WARN +log4j.logger.org.hibernate.event.def.AbstractFlushingEventListener=WARN +log4j.logger.org.hibernate.engine.TwoPhaseLoad=WARN +log4j.logger.org.hibernate.jdbc.AbstractBatcher=WARN +log4j.logger.org.hibernate.hql.ast=WARN +log4j.logger.org.hibernate.engine.loading.CollectionLoadContext=WARN # Jackrabbit logging log4j.logger.org.apache.jackrabbit=WARN, stdout log4j.logger.org.apache.derby=INFO, stdout + +log4j.logger.org.jboss.dna.connector.store=DEBUG Index: dna-integration-tests/src/test/resources/tck/simple-jpa/configRepository.xml =================================================================== --- dna-integration-tests/src/test/resources/tck/simple-jpa/configRepository.xml (revision 0) +++ dna-integration-tests/src/test/resources/tck/simple-jpa/configRepository.xml (revision 0) @@ -0,0 +1,96 @@ + + + + + + + + + + + + Standard extension-based MIME type detector + + org.jboss.dna.graph.mimetype.ExtensionBasedMimeTypeDetector + + + + + + + + + + Store + + + + + + + + + + + + Property changes on: dna-integration-tests\src\test\resources\tck\simple-jpa\configRepository.xml ___________________________________________________________________ Added: svn:keywords + Id Revision Index: dna-integration-tests/src/test/resources/tck/simple-jpa/repositoryOverlay.properties =================================================================== --- dna-integration-tests/src/test/resources/tck/simple-jpa/repositoryOverlay.properties (revision 0) +++ dna-integration-tests/src/test/resources/tck/simple-jpa/repositoryOverlay.properties (revision 0) @@ -0,0 +1 @@ +# Placeholder for any overlaid properties for this repo configuration Index: extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/package-info.java =================================================================== --- extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/package-info.java (revision 1406) +++ extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/package-info.java (working copy) @@ -22,7 +22,7 @@ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ /** - * The classes that define the "basic" storage model for the JPA connector. + * The classes that define the "simple" storage model for the JPA connector. */ package org.jboss.dna.connector.store.jpa.model.simple; Index: extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/ReferenceEntity.java =================================================================== --- extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/ReferenceEntity.java (revision 1406) +++ extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/ReferenceEntity.java (working copy) @@ -1,211 +0,0 @@ -/* - * JBoss DNA (http://www.jboss.org/dna) - * See the COPYRIGHT.txt file distributed with this work for information - * regarding copyright ownership. Some portions may be licensed - * to Red Hat, Inc. under one or more contributor license agreements. - * See the AUTHORS.txt file in the distribution for a full listing of - * individual contributors. - * - * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA - * is licensed to you 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. - * - * JBoss DNA 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.jboss.dna.connector.store.jpa.model.simple; - -import java.util.Collection; -import java.util.List; -import javax.persistence.Entity; -import javax.persistence.EntityManager; -import javax.persistence.Id; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.NoResultException; -import javax.persistence.Query; -import javax.persistence.Table; -import org.hibernate.annotations.Index; - -/** - * A record of a reference from one node to another. - */ -@Entity -@Table( name = "DNA_SIMPLE_REFERENCES" ) -@org.hibernate.annotations.Table( appliesTo = "DNA_SIMPLE_REFERENCES", indexes = { - @Index( name = "REFINDEX_INX", columnNames = {"WORKSPACE_ID", "FROM_UUID", "TO_UUID"} ), - @Index( name = "REFTOUUID_INX", columnNames = {"WORKSPACE_ID", "TO_UUID"} )} ) -@NamedQueries( { - @NamedQuery( name = "ReferenceEntity.removeReferencesFrom", query = "delete ReferenceEntity where id.workspaceId = :workspaceId and id.fromUuidString = :fromUuid" ), - @NamedQuery( name = "ReferenceEntity.removeNonEnforcedReferences", query = "delete ReferenceEntity as ref where ref.id.workspaceId = :workspaceId and ref.id.fromUuidString not in ( select props.id.uuidString from PropertiesEntity props where props.referentialIntegrityEnforced = true and props.id.workspaceId = :workspaceId )" ), - @NamedQuery( name = "ReferenceEntity.countUnresolveReferences", query = "select count(*) from ReferenceEntity as ref where ref.id.workspaceId = :workspaceId and ref.id.toUuidString not in ( select props.id.uuidString from PropertiesEntity props where props.referentialIntegrityEnforced = true and props.id.workspaceId = :workspaceId )" ), - @NamedQuery( name = "ReferenceEntity.getUnresolveReferences", query = "select ref from ReferenceEntity as ref where ref.id.workspaceId = :workspaceId and ref.id.toUuidString not in ( select props.id.uuidString from PropertiesEntity props where props.referentialIntegrityEnforced = true and props.id.workspaceId = :workspaceId )" ), - @NamedQuery( name = "ReferenceEntity.findInWorkspace", query = "select ref from ReferenceEntity as ref where ref.id.workspaceId = :workspaceId" ), - @NamedQuery( name = "ReferenceEntity.getInwardReferencesForList", query = "select ref from ReferenceEntity as ref where ref.id.workspaceId = :workspaceId and ref.id.toUuidString in (:toUuidList)" )} ) -public class ReferenceEntity { - - @Id - private ReferenceId id; - - /** - * - */ - public ReferenceEntity() { - } - - /** - * @param id the id - */ - public ReferenceEntity( ReferenceId id ) { - this.id = id; - } - - /** - * @return id - */ - public ReferenceId getId() { - return id; - } - - /** - * @param id Sets id to the specified value. - */ - public void setId( ReferenceId id ) { - this.id = id; - } - - /** - * {@inheritDoc} - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - return id.hashCode(); - } - - /** - * {@inheritDoc} - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals( Object obj ) { - if (obj == this) return true; - if (obj instanceof ReferenceEntity) { - ReferenceEntity that = (ReferenceEntity)obj; - if (this.getId().equals(that.getId())) return true; - } - return false; - } - - /** - * {@inheritDoc} - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return this.id.toString(); - } - - /** - * Delete all references that start from the node with the supplied UUID. - * - * @param workspaceId the ID of the workspace; may not be null - * @param uuid the UUID of the node from which the references start - * @param manager the manager; may not be null - * @return the number of deleted references - */ - public static int deleteReferencesFrom( Long workspaceId, - String uuid, - EntityManager manager ) { - assert manager != null; - Query delete = manager.createNamedQuery("ReferenceEntity.removeReferencesFrom"); - delete.setParameter("fromUuid", uuid); - delete.setParameter("workspaceId", workspaceId); - int result = delete.executeUpdate(); - manager.flush(); - return result; - } - - /** - * Delete all references (in all workspaces) that start from nodes that do not require enforced referential integrity. - * - * @param workspaceId the ID of the workspace; may not be null - * @param manager the manager; may not be null - * @return the number of deleted references - */ - public static int deleteUnenforcedReferences( Long workspaceId, - EntityManager manager ) { - assert manager != null; - Query delete = manager.createNamedQuery("ReferenceEntity.removeNonEnforcedReferences"); - delete.setParameter("workspaceId", workspaceId); - int result = delete.executeUpdate(); - manager.flush(); - return result; - } - - /** - * Delete all references that start from nodes that do not support enforced referential integrity. - * - * @param workspaceId the ID of the workspace; may not be null - * @param manager the manager; may not be null - * @return the number of deleted references - */ - public static int countAllReferencesResolved( Long workspaceId, - EntityManager manager ) { - assert manager != null; - Query query = manager.createNamedQuery("ReferenceEntity.getUnresolveReferences"); - query.setParameter("workspaceId", workspaceId); - try { - return (Integer)query.getSingleResult(); - } catch (NoResultException e) { - return 0; - } - } - - /** - * Delete all references that start from nodes that do not support enforced referential integrity. - * - * @param workspaceId the ID of the workspace; may not be null - * @param manager the manager; may not be null - * @return the number of deleted references - */ - @SuppressWarnings( "unchecked" ) - public static List verifyAllReferencesResolved( Long workspaceId, - EntityManager manager ) { - assert manager != null; - Query query = manager.createNamedQuery("ReferenceEntity.getUnresolveReferences"); - query.setParameter("workspaceId", workspaceId); - return query.getResultList(); - } - - /** - * Returns a list of all references to UUIDs in the given list within the given workspace - * - * @param workspaceId the ID of the workspace; may not be null - * @param uuids the UUIDs (as strings) of the nodes to check; may not be null - * @param manager the manager; may not be null - * @return the number of deleted references - */ - @SuppressWarnings( "unchecked" ) - public static List getReferencesToUuids( Long workspaceId, - Collection uuids, - EntityManager manager ) { - assert manager != null; - - Query query = manager.createNamedQuery("ReferenceEntity.getInwardReferencesForList"); - query.setParameter("workspaceId", workspaceId); - query.setParameter("toUuidList", uuids); - return query.getResultList(); - } -} Index: extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/ReferenceId.java =================================================================== --- extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/ReferenceId.java (revision 1406) +++ extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/ReferenceId.java (working copy) @@ -1,137 +0,0 @@ -/* - * JBoss DNA (http://www.jboss.org/dna) - * See the COPYRIGHT.txt file distributed with this work for information - * regarding copyright ownership. Some portions may be licensed - * to Red Hat, Inc. under one or more contributor license agreements. - * See the AUTHORS.txt file in the distribution for a full listing of - * individual contributors. - * - * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA - * is licensed to you 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. - * - * JBoss DNA 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.jboss.dna.connector.store.jpa.model.simple; - -import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Embeddable; -import net.jcip.annotations.Immutable; -import org.jboss.dna.common.util.HashCode; - -/** - * An identifier for a reference, comprised of a workspace ID, a single UUID (in string form) of the node containing the - * reference, and a single UUID (in string form) of the node being referenced. - */ -@Embeddable -@Immutable -@org.hibernate.annotations.Immutable -public class ReferenceId implements Serializable { - - /** - * Version {@value} - */ - private static final long serialVersionUID = 1L; - - @Column( name = "WORKSPACE_ID", nullable = false ) - private Long workspaceId; - - @Column( name = "FROM_UUID", nullable = false, updatable = false, length = 36 ) - private String fromUuidString; - - @Column( name = "TO_UUID", nullable = false, updatable = false, length = 36 ) - private String toUuidString; - - public ReferenceId() { - } - - public ReferenceId( Long workspaceId, - String fromUuid, - String toUuid ) { - this.workspaceId = workspaceId; - this.fromUuidString = fromUuid; - this.toUuidString = toUuid; - } - - /** - * @return fromUuidString - */ - public String getFromUuidString() { - return fromUuidString; - } - - /** - * @return toUuidString - */ - public String getToUuidString() { - return toUuidString; - } - - /** - * @return workspaceId - */ - public Long getWorkspaceId() { - return workspaceId; - } - - /** - * {@inheritDoc} - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - return HashCode.compute(fromUuidString, toUuidString); - } - - /** - * {@inheritDoc} - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals( Object obj ) { - if (obj == this) return true; - if (obj instanceof ReferenceId) { - ReferenceId that = (ReferenceId)obj; - if (this.workspaceId == null) { - if (that.workspaceId != null) return false; - } else { - if (!this.workspaceId.equals(that.workspaceId)) return false; - } - if (this.fromUuidString == null) { - if (that.fromUuidString != null) return false; - } else { - if (!this.fromUuidString.equals(that.fromUuidString)) return false; - } - if (this.toUuidString == null) { - if (that.toUuidString != null) return false; - } else { - if (!this.toUuidString.equals(that.toUuidString)) return false; - } - return true; - } - return false; - } - - /** - * {@inheritDoc} - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "Reference from " + fromUuidString + " to " + toUuidString + " in workspace " + workspaceId; - } - -} Index: extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleJpaConnection.java =================================================================== --- extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleJpaConnection.java (revision 1406) +++ extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleJpaConnection.java (working copy) @@ -56,8 +56,7 @@ this.repository = new SimpleJpaRepository(source.getName(), source.getRootUuid(), source.getDefaultWorkspaceName(), source.getPredefinedWorkspaceNames(), entityManager, source.getRepositoryContext().getExecutionContext(), source.isCompressData(), - source.isCreatingWorkspacesAllowed(), source.isReferentialIntegrityEnforced(), - source.getLargeValueSizeInBytes()); + source.isCreatingWorkspacesAllowed(), source.getLargeValueSizeInBytes()); } public boolean ping( long time, @@ -114,7 +113,7 @@ if (logger.isTraceEnabled()) { assert sw != null; sw.stop(); - logger.trace("MapRepositoryConnection.execute(...) took " + sw.getTotalDuration()); + logger.trace(this.getClass().getSimpleName() + ".execute(...) took " + sw.getTotalDuration()); } } } Index: extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleJpaRepository.java =================================================================== --- extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleJpaRepository.java (revision 1406) +++ extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleJpaRepository.java (working copy) @@ -36,6 +36,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -71,7 +72,10 @@ import org.jboss.dna.graph.property.Property; import org.jboss.dna.graph.property.PropertyFactory; import org.jboss.dna.graph.property.PropertyType; +import org.jboss.dna.graph.property.Reference; +import org.jboss.dna.graph.property.UuidFactory; import org.jboss.dna.graph.property.ValueFactories; +import org.jboss.dna.graph.property.ValueFactory; import org.jboss.dna.graph.property.Path.Segment; import org.jboss.dna.graph.request.CompositeRequest; import org.jboss.dna.graph.request.LockBranchRequest.LockScope; @@ -101,8 +105,6 @@ protected final boolean creatingWorkspacesAllowed; protected final long minimumSizeOfLargeValuesInBytes; - // private final boolean referentialIntegrityEnforced; - public SimpleJpaRepository( String sourceName, UUID rootNodeUuid, String defaultWorkspaceName, @@ -111,7 +113,6 @@ ExecutionContext context, boolean compressData, boolean creatingWorkspacesAllowed, - boolean referentialIntegrityEnforced, long minimumSizeOfLargeValuesInBytes ) { super(sourceName, rootNodeUuid, defaultWorkspaceName); @@ -122,7 +123,6 @@ this.predefinedWorkspaceNames = Arrays.asList(predefinedWorkspaceNames); this.compressData = compressData; this.creatingWorkspacesAllowed = creatingWorkspacesAllowed; - // this.referentialIntegrityEnforced = referentialIntegrityEnforced; this.minimumSizeOfLargeValuesInBytes = minimumSizeOfLargeValuesInBytes; this.entityManager = entityManager; @@ -137,7 +137,6 @@ ExecutionContext context, boolean compressData, boolean creatingWorkspacesAllowed, - boolean referentialIntegrityEnforced, long minimumSizeOfLargeValuesInBytes ) { super(sourceName, rootNodeUuid); @@ -148,7 +147,6 @@ this.predefinedWorkspaceNames = Collections.emptyList(); this.compressData = compressData; this.creatingWorkspacesAllowed = creatingWorkspacesAllowed; - // this.referentialIntegrityEnforced = referentialIntegrityEnforced; this.minimumSizeOfLargeValuesInBytes = minimumSizeOfLargeValuesInBytes; this.entityManager = entityManager; @@ -259,6 +257,76 @@ initialize(); } + /** + * This should copy the subgraph given by the original node and place the new copy under the supplied new parent. Note + * that internal references between nodes within the original subgraph must be reflected as internal nodes within the new + * subgraph. + * + * @param context the context; may not be null + * @param original the node to be copied; may not be null + * @param newWorkspace the workspace containing the new parent node; may not be null + * @param newParent the parent where the copy is to be placed; may not be null + * @param desiredName the desired name for the node; if null, the name will be obtained from the original node + * @param recursive true if the copy should be recursive + * @return the new node, which is the top of the new subgraph + */ + @Override + public MapNode copyNode( ExecutionContext context, + MapNode original, + MapWorkspace newWorkspace, + MapNode newParent, + Name desiredName, + boolean recursive ) { + + Map oldToNewUuids = new HashMap(); + MapNode copyRoot = copyNode(context, original, newWorkspace, newParent, desiredName, true, oldToNewUuids); + + // Now, adjust any references in the new subgraph to objects in the original subgraph + // (because they were internal references, and need to be internal to the new subgraph) + PropertyFactory propertyFactory = context.getPropertyFactory(); + UuidFactory uuidFactory = context.getValueFactories().getUuidFactory(); + ValueFactory referenceFactory = context.getValueFactories().getReferenceFactory(); + boolean refChanged = false; + for (Map.Entry oldToNew : oldToNewUuids.entrySet()) { + MapNode oldNode = this.getNode(oldToNew.getKey()); + MapNode newNode = newWorkspace.getNode(oldToNew.getValue()); + assert oldNode != null; + assert newNode != null; + // Iterate over the properties of the new ... + for (Map.Entry entry : newNode.getProperties().entrySet()) { + Property property = entry.getValue(); + // Now see if any of the property values are references ... + List newValues = new ArrayList(); + boolean foundReference = false; + for (Iterator iter = property.getValues(); iter.hasNext();) { + Object value = iter.next(); + PropertyType type = PropertyType.discoverType(value); + if (type == PropertyType.REFERENCE) { + UUID oldReferencedUuid = uuidFactory.create(value); + UUID newReferencedUuid = oldToNewUuids.get(oldReferencedUuid); + if (newReferencedUuid != null) { + newValues.add(referenceFactory.create(newReferencedUuid)); + foundReference = true; + refChanged = true; + } + } else { + newValues.add(value); + } + } + // If we found at least one reference, we have to build a new Property object ... + if (foundReference) { + Property newProperty = propertyFactory.create(property.getName(), newValues); + entry.setValue(newProperty); + } + } + + if (refChanged) { + ((JpaNode)newNode).serializeProperties(); + } + } + return copyRoot; + } + /* * (non-Javadoc) * @see org.jboss.dna.graph.connector.map.AbstractMapWorkspace#correctSameNameSiblingIndexes(org.jboss.dna.graph.ExecutionContext, org.jboss.dna.graph.connector.map.MapNode, org.jboss.dna.graph.property.Name) @@ -303,6 +371,7 @@ NodeEntity nodeEntity = ((JpaNode)node).entity; nodeEntity.setWorkspaceId(this.workspaceId); + nodeEntity.setReferentialIntegrityEnforced(false); entityManager.persist(nodeEntity); } @@ -320,7 +389,7 @@ */ @Override protected void removeUuidReference( MapNode node ) { - SubgraphQuery branch = SubgraphQuery.create(context, entityManager, workspaceId, node.getUuid(), null, 0); + SubgraphQuery branch = SubgraphQuery.create(entityManager, workspaceId, node.getUuid(), 0); branch.deleteSubgraph(true); branch.close(); } @@ -398,12 +467,9 @@ assert subgraphRootUuid != null; } - Path subgraphRootPath = null; // Don't need the path for this - SubgraphQuery subgraph = SubgraphQuery.create(context, - entityManager, + SubgraphQuery subgraph = SubgraphQuery.create(entityManager, workspaceId, subgraphRootUuid, - subgraphRootPath, maximumDepth); List entities = subgraph.getNodes(true, true); Index: extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleRequestProcessor.java =================================================================== --- extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleRequestProcessor.java (revision 1406) +++ extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleRequestProcessor.java (working copy) @@ -148,4 +148,5 @@ super.process(request); } + } Index: extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/SubgraphQuery.java =================================================================== --- extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/SubgraphQuery.java (revision 1406) +++ extensions/dna-connector-store-jpa/src/main/java/org/jboss/dna/connector/store/jpa/model/simple/SubgraphQuery.java (working copy) @@ -27,10 +27,7 @@ import java.util.List; import java.util.UUID; import javax.persistence.EntityManager; -import javax.persistence.NoResultException; import javax.persistence.Query; -import org.jboss.dna.graph.ExecutionContext; -import org.jboss.dna.graph.property.Path; /** * Represents a temporary working area for a query that efficiently retrieves the nodes in a subgraph. This class uses the @@ -47,19 +44,15 @@ /** * Create a query that returns a subgraph at and below the node with the supplied path and the supplied UUID. * - * @param context the execution context; may not be null * @param entities the entity manager; may not be null * @param workspaceId the ID of the workspace; may not be null * @param subgraphRootUuid the UUID (in string form) of the root node in the subgraph - * @param subgraphRootPath the path of the root node in the subgraph * @param maxDepth the maximum depth of the subgraph, or 0 if there is no maximum depth * @return the object representing the subgraph */ - public static SubgraphQuery create( ExecutionContext context, - EntityManager entities, + public static SubgraphQuery create( EntityManager entities, Long workspaceId, UUID subgraphRootUuid, - Path subgraphRootPath, int maxDepth ) { assert entities != null; assert subgraphRootUuid != null; @@ -106,33 +99,26 @@ throw t; } - return new SubgraphQuery(context, entities, workspaceId, query, subgraphRootPath, maxDepth); + return new SubgraphQuery(entities, workspaceId, query, maxDepth); } - // private final ExecutionContext context; private final EntityManager manager; private final Long workspaceId; private SubgraphQueryEntity query; private final int maxDepth; - private final Path subgraphRootPath; - protected SubgraphQuery( ExecutionContext context, - EntityManager manager, + protected SubgraphQuery( EntityManager manager, Long workspaceId, SubgraphQueryEntity query, - Path subgraphRootPath, int maxDepth ) { assert manager != null; assert query != null; - assert context != null; - // assert subgraphRootPath != null; assert workspaceId != null; - // this.context = context; + this.manager = manager; this.workspaceId = workspaceId; this.query = query; this.maxDepth = maxDepth; - this.subgraphRootPath = subgraphRootPath; } /** @@ -150,35 +136,6 @@ } /** - * @return subgraphRootPath - */ - public Path getSubgraphRootPath() { - return subgraphRootPath; - } - - /** - * @return query - */ - public SubgraphQueryEntity getSubgraphQueryEntity() { - if (query == null) throw new IllegalStateException(); - return query; - } - - public int getNodeCount( boolean includeRoot ) { - if (query == null) throw new IllegalStateException(); - // Now query for all the nodes and put into a list ... - Query search = manager.createNamedQuery("SubgraphNodeEntity.getCount"); - search.setParameter("queryId", query.getId()); - - // Now process the nodes below the subgraph's root ... - try { - return ((Long)search.getSingleResult()).intValue() - (includeRoot ? 0 : 1); - } catch (NoResultException e) { - return 0; - } - } - - /** * Get the {@link NodeEntity root node} of the subgraph. This must be called before the query is {@link #close() closed}. * * @return the subgraph's root nodes @@ -219,102 +176,8 @@ } /** - * Get the {@link Location} for each of the nodes in the subgraph. This must be called before the query is {@link #close() - * closed}. - *

- * This method calls {@link #getNodes(boolean,boolean)}. Therefore, calling {@link #getNodes(boolean,boolean)} and this method - * for the same subgraph is not efficient; consider just calling {@link #getNodes(boolean,boolean)} alone. - *

+ * Delete the nodes in the subgraph. * - * @param includeRoot true if the properties for the subgraph's root node are to be included, or false otherwise - * @param includeChildrenOfMaxDepthNodes true if the method is to include nodes that are children of nodes that are at the - * maximum depth, or false if only nodes up to the maximum depth are to be included - * @return the list of {@link Location locations}, one for each of the nodes in the subgraph, in breadth-first order - */ - // public List getNodeLocations( boolean includeRoot, - // boolean includeChildrenOfMaxDepthNodes ) { - // if (query == null) throw new IllegalStateException(); - // // Set up a map of the paths to the nodes, keyed by UUIDs. This saves us from having to build - // // the paths every time ... - // Map pathByUuid = new HashMap(); - // LinkedList locations = new LinkedList(); - // String subgraphRootUuid = query.getRootUuid(); - // pathByUuid.put(subgraphRootUuid, subgraphRootPath); - // UUID uuid = UUID.fromString(subgraphRootUuid); - // if (includeRoot) { - // locations.add(Location.create(subgraphRootPath, uuid)); - // } - // - // // Now iterate over the child nodes in the subgraph (we've already included the root) ... - // final PathFactory pathFactory = context.getValueFactories().getPathFactory(); - // final NameFactory nameFactory = context.getValueFactories().getNameFactory(); - // for (ChildEntity entity : getNodes(false, includeChildrenOfMaxDepthNodes)) { - // String parentUuid = entity.getParentUuidString(); - // Path parentPath = pathByUuid.get(parentUuid); - // assert parentPath != null; - // String nsUri = entity.getChildNamespace().getUri(); - // String localName = entity.getChildName(); - // int sns = entity.getSameNameSiblingIndex(); - // Name childName = nameFactory.create(nsUri, localName); - // Path childPath = pathFactory.create(parentPath, childName, sns); - // String childUuid = entity.getId().getChildUuidString(); - // pathByUuid.put(childUuid, childPath); - // uuid = UUID.fromString(childUuid); - // locations.add(Location.create(childPath, uuid)); - // - // } - // return locations; - // } - - /** - * Get the list of references that are owned by nodes within the subgraph and that point to other nodes in this same - * subgraph. This set of references is important in copying a subgraph, since all intra-subgraph references in the - * original subgraph must also be intra-subgraph references in the copy. - * - * @return the list of references completely contained by this subgraphs - */ - @SuppressWarnings( "unchecked" ) - public List getInternalReferences() { - Query references = manager.createNamedQuery("SubgraphNodeEntity.getInternalReferences"); - references.setParameter("queryId", query.getId()); - references.setParameter("workspaceId", workspaceId); - return references.getResultList(); - } - - /** - * Get the list of references that are owned by nodes within the subgraph and that point to nodes not in this same - * subgraph. This set of references is important in copying a subgraph. - * - * @return the list of references that are owned by the subgraph but that point to nodes outside of the subgraph - */ - @SuppressWarnings( "unchecked" ) - public List getOutwardReferences() { - Query references = manager.createNamedQuery("SubgraphNodeEntity.getOutwardReferences"); - references.setParameter("queryId", query.getId()); - references.setParameter("workspaceId", workspaceId); - return references.getResultList(); - } - - /** - * Get the list of references that are owned by nodes outside of the subgraph that point to nodes in this - * subgraph. This set of references is important in deleting nodes, since such references prevent the deletion of the - * subgraph. - * - * @return the list of references that are no longer valid - */ - @SuppressWarnings( "unchecked" ) - public List getInwardReferences() { - // Verify referential integrity: that none of the deleted nodes are referenced by nodes not being deleted. - Query references = manager.createNamedQuery("SubgraphNodeEntity.getInwardReferences"); - references.setParameter("queryId", query.getId()); - references.setParameter("workspaceId", workspaceId); - return references.getResultList(); - } - - /** - * Delete the nodes in the subgraph. This method first does not check for referential integrity (see - * {@link #getInwardReferences()}). - * * @param includeRoot true if the root node should also be deleted */ @SuppressWarnings( "unchecked" ) @@ -353,13 +216,6 @@ delete.setParameter("workspaceId", workspaceId); delete.executeUpdate(); - // Delete references ... - // delete = manager.createNamedQuery("SubgraphNodeEntity.deleteReferences"); - // delete.setParameter("queryId", query.getId()); - // delete.setParameter("depth", includeRoot ? 0 : 1); - // delete.setParameter("workspaceId", workspaceId); - // delete.executeUpdate(); - // Delete unused large values ... LargeValueEntity.deleteUnused(manager); Index: extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/basic/BasicCreateWorkspacesTest.java =================================================================== --- extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/basic/BasicCreateWorkspacesTest.java (revision 1406) +++ extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/basic/BasicCreateWorkspacesTest.java (working copy) @@ -1,3 +1,26 @@ +/* + * JBoss DNA (http://www.jboss.org/dna) + * See the COPYRIGHT.txt file distributed with this work for information + * regarding copyright ownership. Some portions may be licensed + * to Red Hat, Inc. under one or more contributor license agreements. + * See the AUTHORS.txt file in the distribution for a full listing of + * individual contributors. + * + * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA + * is licensed to you 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. + * + * JBoss DNA 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.jboss.dna.connector.store.jpa.model.basic; import org.jboss.dna.connector.store.jpa.JpaConnectorCreateWorkspacesTest; Index: extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/basic/BasicNoCreateWorkspaceTest.java =================================================================== --- extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/basic/BasicNoCreateWorkspaceTest.java (revision 1406) +++ extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/basic/BasicNoCreateWorkspaceTest.java (working copy) @@ -1,3 +1,26 @@ +/* + * JBoss DNA (http://www.jboss.org/dna) + * See the COPYRIGHT.txt file distributed with this work for information + * regarding copyright ownership. Some portions may be licensed + * to Red Hat, Inc. under one or more contributor license agreements. + * See the AUTHORS.txt file in the distribution for a full listing of + * individual contributors. + * + * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA + * is licensed to you 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. + * + * JBoss DNA 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.jboss.dna.connector.store.jpa.model.basic; import org.jboss.dna.connector.store.jpa.JpaConnectorNoCreateWorkspaceTest; Index: extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/NodeEntityTest.java =================================================================== --- extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/NodeEntityTest.java (revision 1406) +++ extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/NodeEntityTest.java (working copy) @@ -1,3 +1,26 @@ +/* + * JBoss DNA (http://www.jboss.org/dna) + * See the COPYRIGHT.txt file distributed with this work for information + * regarding copyright ownership. Some portions may be licensed + * to Red Hat, Inc. under one or more contributor license agreements. + * See the AUTHORS.txt file in the distribution for a full listing of + * individual contributors. + * + * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA + * is licensed to you 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. + * + * JBoss DNA 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.jboss.dna.connector.store.jpa.model.simple; import static org.hamcrest.core.Is.is; @@ -9,7 +32,6 @@ import javax.persistence.Query; import org.hibernate.ejb.Ejb3Configuration; import org.jboss.dna.connector.store.jpa.model.common.NamespaceEntity; -import org.jboss.dna.graph.ExecutionContext; import org.jboss.dna.graph.property.PropertyType; import org.junit.After; import org.junit.Before; @@ -20,7 +42,6 @@ private static final Boolean SHOW_SQL = false; private static final Boolean USE_CACHE = false; - private ExecutionContext context; private EntityManagerFactory factory; private EntityManager manager; private SimpleModel model; @@ -48,7 +69,6 @@ factory = configurator.buildEntityManagerFactory(); manager = factory.createEntityManager(); - context = new ExecutionContext(); } @After @@ -147,14 +167,12 @@ manager = factory.createEntityManager(); manager.getTransaction().begin(); - SubgraphQuery subgraph = SubgraphQuery.create(context, - manager, + SubgraphQuery subgraph = SubgraphQuery.create(manager, workspaceId, UUID.fromString(rootUuid), - context.getValueFactories().getPathFactory().createRootPath(), 0); - assertThat(subgraph.getNodeCount(false), is(10)); + // assertThat(subgraph.getNodeCount(false), is(10)); subgraph.deleteSubgraph(true); subgraph.close(); Index: extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleCreateWorkspacesTest.java =================================================================== --- extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleCreateWorkspacesTest.java (revision 1406) +++ extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleCreateWorkspacesTest.java (working copy) @@ -1,4 +1,26 @@ -package org.jboss.dna.connector.store.jpa.model.simple; +/* + * JBoss DNA (http://www.jboss.org/dna) + * See the COPYRIGHT.txt file distributed with this work for information + * regarding copyright ownership. Some portions may be licensed + * to Red Hat, Inc. under one or more contributor license agreements. + * See the AUTHORS.txt file in the distribution for a full listing of + * individual contributors. + * + * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA + * is licensed to you 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. + * + * JBoss DNA 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.jboss.dna.connector.store.jpa.model.simple; import org.jboss.dna.connector.store.jpa.JpaConnectorCreateWorkspacesTest; import org.jboss.dna.connector.store.jpa.JpaSource; Index: extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleJpaConnectorReadableTest.java =================================================================== --- extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleJpaConnectorReadableTest.java (revision 1406) +++ extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleJpaConnectorReadableTest.java (working copy) @@ -1,3 +1,26 @@ +/* + * JBoss DNA (http://www.jboss.org/dna) + * See the COPYRIGHT.txt file distributed with this work for information + * regarding copyright ownership. Some portions may be licensed + * to Red Hat, Inc. under one or more contributor license agreements. + * See the AUTHORS.txt file in the distribution for a full listing of + * individual contributors. + * + * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA + * is licensed to you 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. + * + * JBoss DNA 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.jboss.dna.connector.store.jpa.model.simple; import org.jboss.dna.common.statistic.Stopwatch; Index: extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleJpaConnectorWritableTest.java =================================================================== --- extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleJpaConnectorWritableTest.java (revision 1406) +++ extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleJpaConnectorWritableTest.java (working copy) @@ -1,3 +1,26 @@ +/* + * JBoss DNA (http://www.jboss.org/dna) + * See the COPYRIGHT.txt file distributed with this work for information + * regarding copyright ownership. Some portions may be licensed + * to Red Hat, Inc. under one or more contributor license agreements. + * See the AUTHORS.txt file in the distribution for a full listing of + * individual contributors. + * + * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA + * is licensed to you 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. + * + * JBoss DNA 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.jboss.dna.connector.store.jpa.model.simple; import org.jboss.dna.connector.store.jpa.JpaSource; @@ -31,6 +54,7 @@ source.setUrl("jdbc:hsqldb:mem:test"); source.setShowSql(false); source.setAutoGenerateSchema("create"); + source.setReferentialIntegrityEnforced(false); source.initialize(new RepositoryContext() { @@ -57,11 +81,6 @@ return source; } - @Override - public void shouldCopyNodeWithChildren() { - - } - /** * {@inheritDoc} * Index: extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleJpaSourceTest.java =================================================================== --- extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleJpaSourceTest.java (revision 1406) +++ extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleJpaSourceTest.java (working copy) @@ -1,3 +1,26 @@ +/* + * JBoss DNA (http://www.jboss.org/dna) + * See the COPYRIGHT.txt file distributed with this work for information + * regarding copyright ownership. Some portions may be licensed + * to Red Hat, Inc. under one or more contributor license agreements. + * See the AUTHORS.txt file in the distribution for a full listing of + * individual contributors. + * + * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA + * is licensed to you 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. + * + * JBoss DNA 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.jboss.dna.connector.store.jpa.model.simple; import java.util.concurrent.TimeUnit; Index: extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleNoCreateWorkspaceTest.java =================================================================== --- extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleNoCreateWorkspaceTest.java (revision 1406) +++ extensions/dna-connector-store-jpa/src/test/java/org/jboss/dna/connector/store/jpa/model/simple/SimpleNoCreateWorkspaceTest.java (working copy) @@ -1,3 +1,26 @@ +/* + * JBoss DNA (http://www.jboss.org/dna) + * See the COPYRIGHT.txt file distributed with this work for information + * regarding copyright ownership. Some portions may be licensed + * to Red Hat, Inc. under one or more contributor license agreements. + * See the AUTHORS.txt file in the distribution for a full listing of + * individual contributors. + * + * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA + * is licensed to you 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. + * + * JBoss DNA 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.jboss.dna.connector.store.jpa.model.simple; import org.jboss.dna.connector.store.jpa.JpaConnectorNoCreateWorkspaceTest;