mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged up to HEAD.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3129 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
dynamic-insert="false"
|
||||
select-before-update="false"
|
||||
optimistic-lock="version" >
|
||||
<id column="id" length="32" name="id" type="string" />
|
||||
<id column="id" length="64" name="id" type="string" />
|
||||
<property name="description" column="description" type="string" length="1024" />
|
||||
<property name="fixesFromSchema" column="fixes_from_schema" type="integer" />
|
||||
<property name="fixesToSchema" column="fixes_to_schema" type="integer" />
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package org.alfresco.repo.domain.hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import org.alfresco.repo.domain.AppliedPatch;
|
||||
@@ -25,8 +26,10 @@ import org.alfresco.repo.domain.AppliedPatch;
|
||||
*
|
||||
* @author Derek Hulley
|
||||
*/
|
||||
public class AppliedPatchImpl implements AppliedPatch
|
||||
public class AppliedPatchImpl implements AppliedPatch, Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 2694230422651768785L;
|
||||
|
||||
private String id;
|
||||
private String description;
|
||||
private int fixesFromSchema;
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package org.alfresco.repo.domain.hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
|
||||
@@ -29,8 +30,10 @@ import org.alfresco.util.EqualsHelper;
|
||||
/**
|
||||
* @author Derek Hulley
|
||||
*/
|
||||
public class ChildAssocImpl implements ChildAssoc
|
||||
public class ChildAssocImpl implements ChildAssoc, Serializable
|
||||
{
|
||||
private static final long serialVersionUID = -8993272236626580410L;
|
||||
|
||||
private Long id;
|
||||
private Node parent;
|
||||
private Node child;
|
||||
|
@@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.alfresco.repo.domain.hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.repo.domain.DbAccessControlEntry;
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.DbAuthority;
|
||||
@@ -27,8 +29,11 @@ import org.alfresco.util.EqualsHelper;
|
||||
*
|
||||
* @author andyh
|
||||
*/
|
||||
public class DbAccessControlEntryImpl extends LifecycleAdapter implements DbAccessControlEntry
|
||||
public class DbAccessControlEntryImpl extends LifecycleAdapter
|
||||
implements DbAccessControlEntry, Serializable
|
||||
{
|
||||
private static final long serialVersionUID = -418837862334064582L;
|
||||
|
||||
/** The object id */
|
||||
private long id;
|
||||
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package org.alfresco.repo.domain.hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -35,8 +36,11 @@ import org.hibernate.Session;
|
||||
*
|
||||
* @author andyh
|
||||
*/
|
||||
public class DbAccessControlListImpl extends LifecycleAdapter implements DbAccessControlList
|
||||
public class DbAccessControlListImpl extends LifecycleAdapter
|
||||
implements DbAccessControlList, Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 3123277428227075648L;
|
||||
|
||||
private static Log logger = LogFactory.getLog(DbAccessControlListImpl.class);
|
||||
|
||||
private long id;
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package org.alfresco.repo.domain.hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -31,7 +32,8 @@ import org.hibernate.Session;
|
||||
*
|
||||
* @author andyh
|
||||
*/
|
||||
public class DbAuthorityImpl extends LifecycleAdapter implements DbAuthority
|
||||
public class DbAuthorityImpl extends LifecycleAdapter
|
||||
implements DbAuthority, Serializable
|
||||
{
|
||||
private static final long serialVersionUID = -5582068692208928127L;
|
||||
|
||||
|
@@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.alfresco.repo.domain.hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.repo.domain.DbPermission;
|
||||
import org.alfresco.repo.domain.DbPermissionKey;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -31,7 +33,8 @@ import org.hibernate.Session;
|
||||
*
|
||||
* @author andyh
|
||||
*/
|
||||
public class DbPermissionImpl extends LifecycleAdapter implements DbPermission
|
||||
public class DbPermissionImpl extends LifecycleAdapter
|
||||
implements DbPermission, Serializable
|
||||
{
|
||||
private static final long serialVersionUID = -6352566900815035461L;
|
||||
|
||||
|
@@ -52,8 +52,8 @@
|
||||
<map
|
||||
name="properties"
|
||||
table="node_properties"
|
||||
lazy="false"
|
||||
fetch="join"
|
||||
lazy="true"
|
||||
fetch="select"
|
||||
sort="unsorted"
|
||||
inverse="false"
|
||||
optimistic-lock="true"
|
||||
@@ -100,8 +100,8 @@
|
||||
<set
|
||||
name="childAssocs"
|
||||
inverse="true"
|
||||
lazy="false"
|
||||
fetch="join"
|
||||
lazy="true"
|
||||
fetch="select"
|
||||
cascade="none"
|
||||
optimistic-lock="true" >
|
||||
<key column="parent_node_id" />
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package org.alfresco.repo.domain.hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
|
||||
@@ -31,8 +32,10 @@ import org.alfresco.util.EqualsHelper;
|
||||
*
|
||||
* @author Derek Hulley
|
||||
*/
|
||||
public class NodeAssocImpl implements NodeAssoc
|
||||
public class NodeAssocImpl implements NodeAssoc, Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 864534636913524867L;
|
||||
|
||||
private long id;
|
||||
private Node source;
|
||||
private Node target;
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package org.alfresco.repo.domain.hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@@ -43,8 +44,10 @@ import org.alfresco.util.EqualsHelper;
|
||||
*
|
||||
* @author Derek Hulley
|
||||
*/
|
||||
public class NodeImpl extends LifecycleAdapter implements Node
|
||||
public class NodeImpl extends LifecycleAdapter implements Node, Serializable
|
||||
{
|
||||
private static final long serialVersionUID = -2101330674810283053L;
|
||||
|
||||
private Long id;
|
||||
private Store store;
|
||||
private String uuid;
|
||||
|
@@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.alfresco.repo.domain.hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.repo.domain.Node;
|
||||
import org.alfresco.repo.domain.NodeKey;
|
||||
import org.alfresco.repo.domain.NodeStatus;
|
||||
@@ -26,8 +28,10 @@ import org.alfresco.util.EqualsHelper;
|
||||
*
|
||||
* @author Derek Hulley
|
||||
*/
|
||||
public class NodeStatusImpl implements NodeStatus
|
||||
public class NodeStatusImpl implements NodeStatus, Serializable
|
||||
{
|
||||
private static final long serialVersionUID = -802747893314715639L;
|
||||
|
||||
private NodeKey key;
|
||||
private Node node;
|
||||
private String changeTxnId;
|
||||
|
@@ -35,10 +35,12 @@ import org.alfresco.repo.security.permissions.impl.PermissionsDaoComponent;
|
||||
import org.alfresco.repo.security.permissions.impl.SimpleNodePermissionEntry;
|
||||
import org.alfresco.repo.security.permissions.impl.SimplePermissionEntry;
|
||||
import org.alfresco.repo.security.permissions.impl.SimplePermissionReference;
|
||||
import org.alfresco.repo.transaction.TransactionalDao;
|
||||
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.security.AccessStatus;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.Session;
|
||||
import org.springframework.orm.hibernate3.HibernateCallback;
|
||||
@@ -52,7 +54,7 @@ import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
||||
*
|
||||
* @author andyh
|
||||
*/
|
||||
public class PermissionsDaoComponentImpl extends HibernateDaoSupport implements PermissionsDaoComponent
|
||||
public class PermissionsDaoComponentImpl extends HibernateDaoSupport implements PermissionsDaoComponent, TransactionalDao
|
||||
{
|
||||
private static final boolean INHERIT_PERMISSIONS_DEFAULT = true;
|
||||
public static final String QUERY_GET_PERMISSION = "permission.GetPermission";
|
||||
@@ -61,11 +63,70 @@ public class PermissionsDaoComponentImpl extends HibernateDaoSupport implements
|
||||
|
||||
private NodeDaoService nodeDaoService;
|
||||
|
||||
/** a uuid identifying this unique instance */
|
||||
private String uuid;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public PermissionsDaoComponentImpl()
|
||||
{
|
||||
super();
|
||||
this.uuid = GUID.generate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks equality by type and uuid
|
||||
*/
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!(obj instanceof PermissionsDaoComponentImpl))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
PermissionsDaoComponentImpl that = (PermissionsDaoComponentImpl) obj;
|
||||
return this.uuid.equals(that.uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see #uuid
|
||||
*/
|
||||
public int hashCode()
|
||||
{
|
||||
return uuid.hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Does this <tt>Session</tt> contain any changes which must be
|
||||
* synchronized with the store?
|
||||
*
|
||||
* @return true => changes are pending
|
||||
*/
|
||||
public boolean isDirty()
|
||||
{
|
||||
// create a callback for the task
|
||||
HibernateCallback callback = new HibernateCallback()
|
||||
{
|
||||
public Object doInHibernate(Session session)
|
||||
{
|
||||
return session.isDirty();
|
||||
}
|
||||
};
|
||||
// execute the callback
|
||||
return ((Boolean)getHibernateTemplate().execute(callback)).booleanValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Just flushes the session
|
||||
*/
|
||||
public void flush()
|
||||
{
|
||||
getSession().flush();
|
||||
}
|
||||
|
||||
public void setNodeDaoService(NodeDaoService nodeDaoService)
|
||||
{
|
||||
this.nodeDaoService = nodeDaoService;
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package org.alfresco.repo.domain.hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
|
||||
@@ -30,9 +31,11 @@ import org.alfresco.service.cmr.repository.StoreRef;
|
||||
*
|
||||
* @author Derek Hulley
|
||||
*/
|
||||
public class StoreImpl implements Store
|
||||
public class StoreImpl implements Store, Serializable
|
||||
{
|
||||
private StoreKey key;
|
||||
private static final long serialVersionUID = -6135740209100885890L;
|
||||
|
||||
private StoreKey key;
|
||||
private Node rootNode;
|
||||
|
||||
private transient ReadLock refReadLock;
|
||||
|
@@ -16,6 +16,8 @@
|
||||
*/
|
||||
package org.alfresco.repo.domain.hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.repo.domain.StoreKey;
|
||||
import org.alfresco.repo.domain.VersionCount;
|
||||
|
||||
@@ -24,9 +26,11 @@ import org.alfresco.repo.domain.VersionCount;
|
||||
*
|
||||
* @author Derek Hulley
|
||||
*/
|
||||
public class VersionCountImpl implements VersionCount
|
||||
public class VersionCountImpl implements VersionCount, Serializable
|
||||
{
|
||||
private StoreKey key;
|
||||
private static final long serialVersionUID = 6420375860928877809L;
|
||||
|
||||
private StoreKey key;
|
||||
@SuppressWarnings("unused")
|
||||
private long version; // used by Hibernate for concurrency
|
||||
private int versionCount;
|
||||
|
Reference in New Issue
Block a user