private void injectAssociationProperties(ClassNode classNode, List propertiesToAdd) { for (Iterator i = propertiesToAdd.iterator(); i.hasNext(); ) { PropertyNode pn = (PropertyNode) i.next(); if (! /*GrailsASTUtils.*/hasProperty(classNode, pn.getName())) { // if(LOG.isDebugEnabled()) { // LOG.debug("[GrailsDomainInjector] Adding property [" + pn.getName() + "] to class [" + // classNode.getName() + "]"); // } classNode.addProperty(pn); } } }
private void injectIdProperty(ClassNode classNode) { final boolean hasId = /*GrailsASTUtils.*/ hasProperty(classNode, /*GrailsDomainClassProperty.*/ IDENTITY); if (!hasId) { // if(LOG.isDebugEnabled()) { // LOG.debug("[GrailsDomainInjector] Adding property [" + // GrailsDomainClassProperty.IDENTITY + "] to class [" + classNode.getName() + "]"); // } classNode.addProperty( /*GrailsDomainClassProperty.*/ IDENTITY, Modifier.PUBLIC, new ClassNode(Long.class), null, null, null); } }
private void injectVersionProperty(ClassNode classNode) { final boolean hasVersion = /*GrailsASTUtils.*/ hasProperty(classNode, /*GrailsDomainClassProperty.*/ VERSION); if (!hasVersion) { // if(LOG.isDebugEnabled()) { // LOG.debug("[GrailsDomainInjector] Adding property [" + GrailsDomainClassProperty.VERSION // + "] to class [" + classNode.getName() + "]"); // } classNode.addProperty( /*GrailsDomainClassProperty.*/ VERSION, Modifier.PUBLIC, new ClassNode(Long.class), null, null, null); } }