|
Glassfish example source code file (CMPROTemplates.properties)
The Glassfish CMPROTemplates.properties source code# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # # Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. # # The contents of this file are subject to the terms of either the GNU # General Public License Version 2 only ("GPL") or the Common Development # and Distribution License("CDDL") (collectively, the "License"). You # may not use this file except in compliance with the License. You can # obtain a copy of the License at # https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html # or packager/legal/LICENSE.txt. See the License for the specific # language governing permissions and limitations under the License. # # When distributing the software, include this License Header Notice in each # file and include the License file at packager/legal/LICENSE.txt. # # GPL Classpath Exception: # Oracle designates this particular file as subject to the "Classpath" # exception as provided by Oracle in the GPL Version 2 section of the License # file that accompanied this code. # # Modifications: # If applicable, add the following below the License Header, with the fields # enclosed by brackets [] replaced by your own identifying information: # "Portions Copyright [year] [name of copyright owner]" # # Contributor(s): # If you wish your version of this file to be governed by only the CDDL or # only the GPL Version 2, indicate your decision by adding "[Contributor] # elects to include this software in this distribution under the [CDDL or GPL # Version 2] license." If you don't indicate a single choice of license, a # recipient has the option to distribute your version of this file under # either the CDDL, the GPL Version 2 or to extend the choice of license to # its licensees as provided above. However, if you add GPL Version 2 code # and therefore, elected the GPL Version 2 license, then the option applies # only if the new code is made subject to such option by the copyright # holder. # # # ----------------------------------------------------------------------------- # Read-only beans specific properties # ----------------------------------------------------------------------------- # # # Code Signature via CVS keyword substitution # signature = $RCSfile: CMPROTemplates.properties,v $ $Revision: 1.3 $ # # Variables: # # PLEASE NOTE, all internal variables should start with _jdo # to avoid name clashes with CMR variables. # privateStaticFinalVariables=\ java.util.Map _jdoPersistenceManagers new java.util.Hashtable()\n\ # {0} - PC Class privateTransientVariables=\ {0} _jdoInstance0 null\n\ # # Methods # # {0} - getter name. loadNonDFG=\ _jdoInstance0.{0}();\n # # ----------------------------------------------------------------------------- # Generic Methods # ----------------------------------------------------------------------------- # # {0} - PK Class. # {1} - PC Class. # {2} - block to load non-DFG fields jdoGetInstance=\ try '{'\n\ \tif (_jdoInstance0 == null) '{'\n\ \t\t{0} key = ({0}) _jdoEntityContext.getPrimaryKey();\n\ \t\tObject jdoObjectId = jdoGetObjectId(key); \n\ \t\tcom.sun.jdo.api.persistence.support.PersistenceManager _jdoPersistenceManager0 = jdoGetPersistenceManagerByPK(key);\n\ \t\t_jdoInstance0 = ({1}) _jdoPersistenceManager0.getObjectById(jdoObjectId, false);\n\ \t\t{2}\n\ \t'}'\n\ \t_jdoInstance = ({1})(_jdoInstance0).clone();\n\ '}' catch (CloneNotSupportedException ex) '{'\n\ \tcom.sun.jdo.spi.persistence.support.ejb.cmp.CMPBeanHelper.handleCloneException(\n\ \t\t_jdoEntityContext.getPrimaryKey(), _jdoBeanName, ex);\n\ '}' jdoGetPersistenceManager=\ if(_jdoPersistenceManagerFactory == null) {\n\ \tthrow new com.sun.jdo.api.persistence.support.JDOFatalInternalException(\n\ \t\torg.glassfish.persistence.common.I18NHelper.getMessage(\n\ \t\t\t_jdoMessages, "JDO.pmfnull_exception"));\n\ }\n\ javax.transaction.Transaction t = \n\ \tcom.sun.jdo.spi.persistence.support.sqlstore.ejb.CMPHelper.suspendCurrentTransaction();\n\ com.sun.jdo.api.persistence.support.PersistenceManager _jdopm = _jdoPersistenceManagerFactory.getPersistenceManager();\n\ com.sun.jdo.spi.persistence.support.sqlstore.ejb.CMPHelper.resumeCurrentTransaction(t);\n\ return _jdopm; jdoGetPersistenceManager0=\ return jdoGetPersistenceManagerByPK(key); jdoReleasePersistenceManager0=\ jdoGetPersistenceManagerByPK=\ if(_jdoPersistenceManagerFactory == null) {\n\ \tthrow new com.sun.jdo.api.persistence.support.JDOFatalInternalException(\n\ \t\torg.glassfish.persistence.common.I18NHelper.getMessage(\n\ \t\t\t_jdoMessages, "JDO.pmfnull_exception"));\n\ }\n\ com.sun.jdo.api.persistence.support.PersistenceManager _jdopm = (com.sun.jdo.api.persistence.support.PersistenceManager) _jdoPersistenceManagers.get(key);\n\ if (_jdopm == null) {\n\ \tjavax.transaction.Transaction t = \n\ \t\tcom.sun.jdo.spi.persistence.support.sqlstore.ejb.CMPHelper.suspendCurrentTransaction();\n\ \t_jdopm = _jdoPersistenceManagerFactory.getPersistenceManager();\n\ \tcom.sun.jdo.spi.persistence.support.sqlstore.ejb.CMPHelper.resumeCurrentTransaction(t);\n\ \t_jdoPersistenceManagers.put(key, _jdopm);\n\ } else if(_jdopm.isClosed()) {\n\ \tthrow new com.sun.jdo.api.persistence.support.JDOFatalInternalException(\n\ \t\torg.glassfish.persistence.common.I18NHelper.getMessage(\n\ \t\t\t_jdoMessages, "JDO.pm_closed_exception"));\n\ }\n\ return _jdopm; jdoClosePersistenceManager=\ if (_jdoPersistenceManager != null) {\n\ \t_jdoPersistenceManager.close();\n\ } # {0} - Concrete Impl class name. jdoLookupPersistenceManagerFactory=\ if (_jdoPersistenceManagerFactory == null) '{'\n\ \t_jdoPersistenceManagerFactory = \n\ \t\tcom.sun.jdo.spi.persistence.support.sqlstore.ejb.CMPHelper.getPersistenceManagerFactory(\n\ \t\t\t{0}_JDOHelper.getHelperInstance().getContainer());\n\ \t_jdoPersistenceManagerFactory.setRequireCopyObjectId(false);\n\ \t_jdoPersistenceManagerFactory.setRequireTrackedSCO(false);\n\ \t_jdoPersistenceManagerFactory.setNontransactionalRead(true);\n\ \t_jdoNumericConverter = {0}_JDOHelper.getHelperInstance().getNumericConverter();\n\ '}' # This template must have a new line at the end # to be displayed properly in the generated code. assertPersistenceManagerIsNull=\ # {0} - PK Class # {1} - PC Class # {2} - block to load non-DFG fields ejb__refresh=\ try '{'\n\ \t{0} key = ({0}) _jdoEntityContext.getPrimaryKey();\n\ \tObject jdoObjectId = jdoGetObjectId(key); \n\ \tcom.sun.jdo.api.persistence.support.PersistenceManager _jdoPersistenceManager0 = jdoGetPersistenceManagerByPK(key);\n\ \t_jdoInstance0 = ({1})_jdoPersistenceManager0.getObjectById(jdoObjectId, true);\n\ \t{2}\n\ '}' catch (com.sun.jdo.api.persistence.support.JDOException ex) '{'\n\ \tcom.sun.jdo.spi.persistence.support.ejb.cmp.CMPBeanHelper.logJDOExceptionWithLifecycleLogger(\n\ \t\t"GEN.generic_method_exception", _jdoBeanName, ex);\n\ \tthrow (ex instanceof com.sun.jdo.api.persistence.support.JDOObjectNotFoundException) ? \n\ \t\t(RuntimeException) new NoSuchEntityException(ex) : ex;\n\ '}' # This is the body for setters, ejbPostClreate, ejbRemove, and ejbStore. updateNotAllowed=\ com.sun.jdo.spi.persistence.support.ejb.cmp.CMPBeanHelper.handleUpdateNotAllowedException(_jdoBeanName); # This is the body for ejbCreate and CMR getters as they return a value accessNotAllowed=\ com.sun.jdo.spi.persistence.support.ejb.cmp.CMPBeanHelper.handleUpdateNotAllowedException(_jdoBeanName);\n\ return null; jdoCleanAllRefs=\ _jdoInstance0 = null;\n\ _jdoInstance = null;\n\ _jdoPersistenceManager = null; # # ----------------------------------------------------------------------------- # End of Generic Methods # ----------------------------------------------------------------------------- # # # ----------------------------------------------------------------------------- # End of Read-only beans specific properties # ----------------------------------------------------------------------------- # Other Glassfish examples (source code examples)Here is a short list of links related to this Glassfish CMPROTemplates.properties source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.