buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/ORMCommitCount.java
changeset 640 ac0bbc1e5d79
parent 639 0e65f93be3cb
parent 633 a4eca1f021ac
child 641 8dd670a9f34f
child 656 88e01c8f013e
--- a/buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/ORMCommitCount.java	Mon Sep 06 09:57:24 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  
- *
- */
-
-package com.nokia.helium.jpa;
-
-import org.apache.log4j.Logger;
-import javax.persistence.EntityManager;
-
-/**
- * This class is used to keep track of number of objects
- * remaining to be commited to the database.
- */
-public class ORMCommitCount {
-
-    private static Logger log = Logger.getLogger(ORMCommitCount.class);
-
-    private static final int PERSISTANCE_COUNT_LIMIT = 1000;
-
-    private static EntityManager entityManager;
-
-    private int count;
-
-    /** Constructor.
-     */
-    public ORMCommitCount() {
-        count = PERSISTANCE_COUNT_LIMIT;
-    }
-
-    /**
-     * Reduce the commit count value by one.
-     */
-    public void decreaseCount() {
-        count --;
-    }
-
-    /**
-     * Reset to maximum limit
-     */
-    public void reset() {
-        count = PERSISTANCE_COUNT_LIMIT;
-    }
-
-    /**
-     * Returns whether the commit is required or not.
-     * @return if commit required returns true otherwise false.
-     */
-    public boolean isCommitRequired() {
-        return count == 0;
-    }
-
-    /**
-     * Returns whether if there are any data to commit
-     * @return true if any data there to commit, otherwise false.
-     */
-    public boolean isDatatoCommit() {
-        //log.debug("isDatatoCommit: " + (count < PERSISTANCE_COUNT_LIMIT));
-        return count < PERSISTANCE_COUNT_LIMIT;
-    }
-}
\ No newline at end of file