| /******************************************************************************* |
| * Copyright (c) 2008 Oracle. All rights reserved. |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License v1.0, which accompanies this distribution |
| * and is available at http://www.eclipse.org/legal/epl-v10.html. |
| * |
| * Contributors: |
| * Oracle - initial API and implementation |
| ******************************************************************************/ |
| package org.eclipse.jpt.eclipselink.core.internal.context.java; |
| |
| import java.util.List; |
| import org.eclipse.jdt.core.dom.CompilationUnit; |
| import org.eclipse.jpt.core.context.java.JavaPersistentType; |
| import org.eclipse.jpt.core.internal.context.java.GenericJavaEntity; |
| import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; |
| import org.eclipse.jpt.eclipselink.core.EclipseLinkJpaFactory; |
| import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaCaching; |
| import org.eclipse.jpt.eclipselink.core.context.java.EclipseLinkJavaEntity; |
| import org.eclipse.wst.validation.internal.provisional.core.IMessage; |
| |
| public class EclipseLinkJavaEntityImpl extends GenericJavaEntity implements EclipseLinkJavaEntity |
| { |
| protected EclipseLinkJavaCaching eclipseLinkCaching; |
| |
| public EclipseLinkJavaEntityImpl(JavaPersistentType parent) { |
| super(parent); |
| this.eclipseLinkCaching = getJpaFactory().buildEclipseLinkJavaCaching(this); |
| } |
| |
| |
| public EclipseLinkJavaCaching getCaching() { |
| return this.eclipseLinkCaching; |
| } |
| |
| @Override |
| protected EclipseLinkJpaFactory getJpaFactory() { |
| return (EclipseLinkJpaFactory) super.getJpaFactory(); |
| } |
| |
| |
| @Override |
| public void update(JavaResourcePersistentType resourcePersistentType) { |
| super.update(resourcePersistentType); |
| this.eclipseLinkCaching.update(resourcePersistentType); |
| } |
| |
| @Override |
| public void initialize(JavaResourcePersistentType resourcePersistentType) { |
| super.initialize(resourcePersistentType); |
| this.eclipseLinkCaching.initialize(resourcePersistentType); |
| } |
| |
| //********** Validation ******************************************** |
| |
| @Override |
| public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) { |
| super.addToMessages(messages, astRoot); |
| getCaching().addToMessages(messages, astRoot); |
| } |
| } |