JBoss Tools SVN: r31363 - trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-18 20:45:22 -0400 (Wed, 18 May 2011)
New Revision: 31363
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamBeansTest.java
Log:
JBIDE-8674
https://issues.jboss.org/browse/JBIDE-8674
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamBeansTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamBeansTest.java 2011-05-19 00:44:51 UTC (rev 31362)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamBeansTest.java 2011-05-19 00:45:22 UTC (rev 31363)
@@ -279,7 +279,7 @@
Set<IQualifierDeclaration> qs = b.getQualifierDeclarations();
Map<String, IQualifierDeclaration> map = new HashMap<String, IQualifierDeclaration>();
for (IQualifierDeclaration q: qs) {
- map.put(q.getType().getFullyQualifiedName(), q);
+ map.put(q.getTypeName(), q);
}
IQualifierDeclaration myQualifier = map.get("org.jboss.beans.test04.MyQualifier");
assertNotNull(myQualifier);
@@ -312,7 +312,7 @@
Set<IQualifierDeclaration> qs = b.getQualifierDeclarations();
Map<String, IQualifierDeclaration> map = new HashMap<String, IQualifierDeclaration>();
for (IQualifierDeclaration q: qs) {
- map.put(q.getType().getFullyQualifiedName(), q);
+ map.put(q.getTypeName(), q);
}
IQualifierDeclaration myQualifier = map.get("org.jboss.beans.test04.MyQualifier");
assertNotNull(myQualifier);
@@ -365,7 +365,7 @@
Set<IQualifierDeclaration> qs = p.getQualifierDeclarations();
Map<String, IQualifierDeclaration> map = new HashMap<String, IQualifierDeclaration>();
for (IQualifierDeclaration q: qs) {
- map.put(q.getType().getFullyQualifiedName(), q);
+ map.put(q.getTypeName(), q);
}
IQualifierDeclaration myQualifier = map.get("org.jboss.beans.test04.MyQualifier");
assertNotNull(myQualifier);
13 years, 4 months
JBoss Tools SVN: r31362 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl: definition and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-18 20:44:51 -0400 (Wed, 18 May 2011)
New Revision: 31362
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java
Log:
JBIDE-8674
https://issues.jboss.org/browse/JBIDE-8674
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-05-18 23:57:43 UTC (rev 31361)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-05-19 00:44:51 UTC (rev 31362)
@@ -338,7 +338,7 @@
}
} else {
for (IQualifierDeclaration d: qs) {
- if(CDIConstants.NEW_QUALIFIER_TYPE_NAME.equals(d.getType().getFullyQualifiedName())) {
+ if(CDIConstants.NEW_QUALIFIER_TYPE_NAME.equals(d.getTypeName())) {
isNew = true;
break;
}
@@ -504,7 +504,7 @@
beanKeys.add(CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME);
} else {
for (IAnnotationDeclaration d: beanQualifiers) {
- beanKeys.add(d.getType().getFullyQualifiedName());
+ beanKeys.add(d.getTypeName());
}
}
if(beanKeys.size() == 1 && beanKeys.iterator().next().startsWith(CDIConstants.NAMED_QUALIFIER_TYPE_NAME)) {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2011-05-18 23:57:43 UTC (rev 31361)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2011-05-19 00:44:51 UTC (rev 31362)
@@ -157,8 +157,7 @@
Iterator<IAnnotationDeclaration> it = annotations.iterator();
while(it.hasNext()) {
IAnnotationDeclaration a1 = it.next();
- IType t = a1.getType();
- if(t != null && typeName.equals(t.getFullyQualifiedName())) it.remove();
+ if(typeName.equals(a1.getTypeName())) it.remove();
}
//Make sure that a is non-specific annotation.
addAnnotation(new AnnotationDeclaration(a), context);
13 years, 4 months
JBoss Tools SVN: r31361 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/impl and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-18 19:57:43 -0400 (Wed, 18 May 2011)
New Revision: 31361
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java
Log:
JBIDE-8674
https://issues.jboss.org/browse/JBIDE-8674
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java 2011-05-18 22:39:31 UTC (rev 31360)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IAnnotationDeclaration.java 2011-05-18 23:57:43 UTC (rev 31361)
@@ -47,6 +47,13 @@
IMember getParentMember();
/**
+ * Returns the corresponding type name of the annotation.
+ *
+ * @return the corresponding type name of the annotation
+ */
+ String getTypeName();
+
+ /**
* Returns the corresponding IType of the annotation. May be null.
*
* @return the corresponding IType of the annotation
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java 2011-05-18 22:39:31 UTC (rev 31360)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java 2011-05-18 23:57:43 UTC (rev 31361)
@@ -48,6 +48,10 @@
this.annotation = annotation;
}
+ public IJavaAnnotation getDeclaration() {
+ return annotation;
+ }
+
public IResource getResource() {
return annotation.getResource();
}
13 years, 4 months
JBoss Tools SVN: r31360 - in trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui: marker and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-05-18 18:39:31 -0400 (Wed, 18 May 2011)
New Revision: 31360
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java
Log:
https://issues.jboss.org/browse/JBIDE-8957
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2011-05-18 19:45:26 UTC (rev 31359)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2011-05-18 22:39:31 UTC (rev 31360)
@@ -104,7 +104,7 @@
ADD_QUALIFIERS_TO_BEAN_WIZARD_ADD_ALL=Add All >>
ADD_QUALIFIERS_TO_BEAN_WIZARD_REMOVE=< Remove
ADD_QUALIFIERS_TO_BEAN_WIZARD_REMOVE_ALL=<< Remove All
-ADD_QUALIFIERS_TO_BEAN_WIZARD_CREATE_NEW_QUALIFIER=Create New Qualifier
+ADD_QUALIFIERS_TO_BEAN_WIZARD_CREATE_NEW_QUALIFIER=Create New Qualifier...
ADD_QUALIFIERS_TO_BEAN_WIZARD_SET_IS_NOT_UNIQUE=This set of qualifiers is not unique
ADD_QUALIFIERS_TO_BEAN_WIZARD_ENTER_QUALIFIER_NAME=Enter CDI Qualifier name prefix or pattern (? = any character, * = any string):
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java 2011-05-18 19:45:26 UTC (rev 31359)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java 2011-05-18 22:39:31 UTC (rev 31360)
@@ -280,14 +280,11 @@
IBuffer buffer = compilationUnit.getBuffer();
- MethodStructure ms = parseMethod(m, buffer.getContents());
- if(ms == null)
- return;
-
- for(Parameter parameter : ms.getParameters()){
- if(parameter.getName().equals(paramName)){
+ ILocalVariable[] parameters = m.getParameters();
+ for(int index = 0; index < parameters.length; index++){
+ if(parameters[index].getElementName().equals(paramName)){
StringBuffer b = new StringBuffer();
- if(parameter.getIndex() > 0)
+ if(index > 0)
b.append(SPACE);
for(IQualifier qualifier : qualifiers){
String qualifierName = qualifier.getSourceType().getFullyQualifiedName();
@@ -297,14 +294,14 @@
if(duplicant)
annotation = qualifierName;
if(qualifierName.equals(CDIConstants.NAMED_QUALIFIER_TYPE_NAME))
- b.append(AT+annotation+"(\""+parameter.getName()+"\")"+SPACE);
+ b.append(AT+annotation+"(\""+parameters[index].getElementName()+"\")"+SPACE);
else
b.append(AT+annotation+SPACE);
}
}
- b.append(parameter.getType()+SPACE);
- b.append(parameter.getName());
- buffer.replace(parameter.getOffset(), parameter.getLength(), b.toString());
+ b.append(Signature.getSignatureSimpleName(parameters[index].getTypeSignature())+SPACE);
+ b.append(parameters[index].getElementName());
+ buffer.replace(parameters[index].getSourceRange().getOffset(), parameters[index].getSourceRange().getLength(), b.toString());
}
}
@@ -322,12 +319,9 @@
IBuffer buffer = compilationUnit.getBuffer();
- MethodStructure ms = parseMethod(method, buffer.getContents());
- if(ms == null)
- return null;
- for(Parameter parameter : ms.getParameters()){
- if(parameter.getName().equals(paramName)){
- return new SourceRange(parameter.getOffset(), parameter.getLength());
+ for(ILocalVariable parameter : method.getParameters()){
+ if(parameter.getElementName().equals(paramName)){
+ return new SourceRange(parameter.getSourceRange().getOffset(), parameter.getSourceRange().getLength());
}
}
}catch(JavaModelException ex){
@@ -348,78 +342,7 @@
return null;
}
- static void getParams(IMethod method, MethodStructure ms, String paramsString, int offset) throws JavaModelException{
- String[] types = method.getParameterTypes();
- String[] names = method.getParameterNames();
-
- int paramIndex = 0;
- int paramPosition = 0;
- int i = 0;
- int c1 = 0;
- int c2 = 0;
- char quote = '\0';
- StringBuffer sb = new StringBuffer();
- while(i < paramsString.length()) {
- char c = paramsString.charAt(i);
- if(c == ',' && c1 == 0 && c2 == 0 && quote == '\0') {
- if(sb.toString().trim().length() > 0) {
- String param = sb.toString();
- Parameter parameter = new Parameter(paramIndex, Signature.getSignatureSimpleName(types[paramIndex]), names[paramIndex], offset+paramPosition, param.length());
- paramIndex++;
- ms.addParameter(parameter);
- paramPosition = i+1;
- }
- sb.setLength(0);
- i++;
- continue;
- } else if(c == '(' && quote == '\0') {
- c1++;
- } else if(c == ')' && quote == '\0') {
- c1--;
- } else if(c == '<' && quote == '\0') {
- c2++;
- } else if(c == '>' && quote == '\0') {
- c2--;
- } else if((c == '\'' || c == '"') && quote == '\0') {
- quote = c;
- } else if(quote == c) {
- quote = '\0';
- }
- sb.append(c);
- i++;
- }
- if(sb.length() > 0) {
- String param = sb.toString();
- Parameter parameter = new Parameter(paramIndex, Signature.getSignatureSimpleName(types[paramIndex]), names[paramIndex], offset+paramPosition, param.length());
- paramIndex++;
- ms.addParameter(parameter);
- paramPosition = i+1;
- }
- }
-
- private static MethodStructure parseMethod(IMethod method, String text){
- try{
- MethodStructure ms = new MethodStructure();
- ISourceRange range = method.getSourceRange();
- ISourceRange nameRange = method.getNameRange();
- if(nameRange != null) range = nameRange;
- int paramStart = text.indexOf('(', range.getOffset());
- if(paramStart < 0) return null;
- int declEnd = text.indexOf('{', paramStart);
- if(declEnd < 0) return null;
- int paramEnd = text.lastIndexOf(')', declEnd);
- if(paramEnd < 0) return null;
- String paramsString = text.substring(paramStart + 1, paramEnd);
- getParams(method, ms, paramsString, paramStart+1);
-
- return ms;
- }catch(JavaModelException ex){
- CDIUIPlugin.getDefault().logError(ex);
- }
- return null;
- }
-
public static void addQualifiersToInjectedPoint(IInjectionPoint injectionPoint, IBean bean){
try{
ICompilationUnit original = injectionPoint.getClassBean().getBeanClass().getCompilationUnit();
@@ -527,52 +450,4 @@
}
return null;
}
-
- static class MethodStructure{
- List<Parameter> parameters = new ArrayList<Parameter>();
-
- public List<Parameter> getParameters(){
- return parameters;
- }
-
- public void addParameter(Parameter parameter){
- parameters.add(parameter);
- }
- }
-
- static class Parameter{
- String type;
- String name;
- int offset, length;
- int index;
-
- public Parameter(int index, String type, String name, int offset, int length){
- this.index = index;
- this.type = type;
- this.name = name;
- this.offset = offset;
- this.length = length;
- }
-
- public int getOffset(){
- return offset;
- }
-
- public int getLength(){
- return length;
- }
-
- public String getType(){
- return type;
- }
-
- public String getName(){
- return name;
- }
-
- public int getIndex(){
- return index;
- }
- }
-
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java 2011-05-18 19:45:26 UTC (rev 31359)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java 2011-05-18 22:39:31 UTC (rev 31360)
@@ -12,6 +12,7 @@
*******************************************************************************/
package org.jboss.tools.cdi.ui.wizard.xpl;
+import java.lang.reflect.InvocationTargetException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashSet;
@@ -19,11 +20,13 @@
import java.util.Set;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IContentProvider;
import org.eclipse.jface.viewers.IDoubleClickListener;
@@ -61,6 +64,8 @@
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.SearchPattern;
+import org.jboss.tools.cdi.core.CDICoreMessages;
+import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IQualifier;
@@ -99,6 +104,8 @@
private Label nLabel;
protected boolean isComplete = true;
+
+ private ILabelProvider labelProvider;
public AddQualifiersToBeanComposite(Composite parent, WizardPage wizard) {
super(parent, SWT.NONE);
@@ -120,13 +127,15 @@
qualifiers.clear();
loadAvailableQualifiers();
+ availableListViewer.setInput(qualifiers);
if(nLabel != null)
nLabel.setText(MessageFormat.format(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_MESSAGE,
new Object[]{bean.getBeanClass().getElementName()}));
refresh();
}
- private void loadAvailableQualifiers(){
+ private IQualifier loadAvailableQualifiers(){
+ IQualifier lastQualifier = null;
String beanTypeName = bean.getBeanClass().getFullyQualifiedName();
String beanPackage = beanTypeName.substring(0,beanTypeName.lastIndexOf(MarkerResolutionUtils.DOT));
@@ -136,10 +145,9 @@
boolean samePackage = beanPackage.equals(injectionPointPackage);
IQualifier[] qs = bean.getCDIProject().getQualifiers();
- qualifiers = new ArrayList<IQualifier>();
for(IQualifier q : qs){
- if(!originalQualifiers.contains(q)){
+ if(!contains(originalQualifiers, q) && !contains(qualifiers, q) && !contains(deployed, q)){
boolean isPublic = true;
try{
isPublic = Flags.isPublic(q.getSourceType().getFlags());
@@ -148,13 +156,24 @@
}
String qualifierTypeName = q.getSourceType().getFullyQualifiedName();
String qualifierPackage = qualifierTypeName.substring(0,qualifierTypeName.lastIndexOf(MarkerResolutionUtils.DOT));
- if(isPublic || (samePackage && injectionPointPackage.equals(qualifierPackage)))
+ if((isPublic || (samePackage && injectionPointPackage.equals(qualifierPackage))) ){
qualifiers.add(q);
+ lastQualifier = q;
+ }
}
}
- availableListViewer.setInput(qualifiers);
-
+ return lastQualifier;
}
+
+ private boolean contains(ArrayList<IQualifier> qualifiers, IQualifier qualifier){
+ String qualifierText = labelProvider.getText(qualifier);
+ for(IQualifier q : qualifiers){
+ String qText = labelProvider.getText(q);
+ if(qText.equals(qualifierText))
+ return true;
+ }
+ return false;
+ }
public void setVisible(boolean visible) {
if (visible)
@@ -275,7 +294,7 @@
availableList.setLayoutData(data);
availableListViewer = new ListViewer(availableList);
- ILabelProvider labelProvider = new QualifiersListLabelProvider();
+ labelProvider = new QualifiersListLabelProvider();
availableListViewer.setLabelProvider(labelProvider);
IContentProvider contentProvider = new QualifiersListContentProvider();
availableListViewer.setContentProvider(contentProvider);
@@ -390,6 +409,13 @@
}
});
+ label = new Label(this, SWT.NONE);
+ label.setText("");
+
+ label = new Label(this, SWT.NONE);
+ label.setText("");
+
+
final Button createQualifier = new Button(this, SWT.PUSH);
createQualifier.setText(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_CREATE_NEW_QUALIFIER);
@@ -404,23 +430,40 @@
int status = dialog.open();
if(status == WizardDialog.OK){
// reload qualifiers
- try {
- Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
- } catch (InterruptedException e) {
- // do nothing
+ if (Display.getCurrent() != null) {
+ try{
+ PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress(){
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ monitor.beginTask(CDICoreMessages.CDI_UTIL_BUILD_CDI_MODEL, 10);
+ monitor.worked(3);
+
+ try {
+ Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
+ } catch (InterruptedException e) {
+ // do nothing
+ }
+
+ monitor.worked(7);
+ }
+ });
+ }catch(InterruptedException ie){
+ CDICorePlugin.getDefault().logError(ie);
+ }catch(InvocationTargetException ite){
+ CDICorePlugin.getDefault().logError(ite);
+ }
}
- qualifiers.clear();
+ IQualifier q = loadAvailableQualifiers();
- loadAvailableQualifiers();
-
- refresh();
+ if(q != null){
+ moveAll(new IQualifier[]{q}, true);
+ }
}
}
});
setEnablement();
- //availableList.setFocus();
Dialog.applyDialogFont(this);
}
@@ -456,7 +499,7 @@
for (int i = 0; i < ms.length; i++) {
IQualifier qualifier = ms[i];
if (qualifier != null) {
- if (qualifiers.contains(qualifier)) {
+ if (contains(qualifiers, qualifier)) {
enabled = true;
}else{
enabled = false;
@@ -475,7 +518,7 @@
boolean enabled = false;
for (int i = 0; i < ms.length; i++) {
IQualifier qualifier = ms[i];
- if (qualifier != null && deployed.contains(qualifier)) {
+ if (qualifier != null && contains(deployed, qualifier)) {
enabled = true;
}
else{
@@ -524,7 +567,7 @@
int size = mods.length;
ArrayList<IQualifier> list = new ArrayList<IQualifier>();
for (int i = 0; i < size; i++) {
- if (!list.contains(mods[i]))
+ if (!contains(list, mods[i]))
list.add(mods[i]);
}
@@ -553,7 +596,7 @@
Iterator iterator = originalQualifiers.iterator();
while (iterator.hasNext()) {
IQualifier qualifier = (IQualifier) iterator.next();
- if (!deployed.contains(qualifier))
+ if (!contains(deployed, qualifier))
list.add(qualifier);
}
return list;
@@ -564,7 +607,7 @@
Iterator iterator = deployed.iterator();
while (iterator.hasNext()) {
IQualifier qualifier = (IQualifier) iterator.next();
- if (!originalQualifiers.contains(qualifier))
+ if (!contains(originalQualifiers, qualifier))
list.add(qualifier);
}
return list;
13 years, 4 months
JBoss Tools SVN: r31358 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/impl/definition and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-18 14:39:29 -0400 (Wed, 18 May 2011)
New Revision: 31358
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IJavaAnnotation.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java
Log:
JBIDE-8674
https://issues.jboss.org/browse/JBIDE-8674
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2011-05-18 15:39:00 UTC (rev 31357)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2011-05-18 18:39:29 UTC (rev 31358)
@@ -553,10 +553,10 @@
}
if(sourceType.isInterface()) {
IAnnotation annotation = sourceType.getAnnotation(CDIConstants.LOCAL_ANNOTATION_TYPE_NAME);
- if (annotation == null || !annotation.exists()) {
+ if (!annotation.exists()) {
annotation = sourceType.getAnnotation("Local"); //$NON-NLS-N1
}
- if (annotation != null && CDIConstants.LOCAL_ANNOTATION_TYPE_NAME.equals(EclipseJavaUtil.resolveType(sourceType, "Local"))) { //$NON-NLS-N1
+ if (annotation.exists() && CDIConstants.LOCAL_ANNOTATION_TYPE_NAME.equals(EclipseJavaUtil.resolveType(sourceType, "Local"))) { //$NON-NLS-N1
sourceTypes.add(sourceType);
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IJavaAnnotation.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IJavaAnnotation.java 2011-05-18 15:39:00 UTC (rev 31357)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IJavaAnnotation.java 2011-05-18 18:39:29 UTC (rev 31358)
@@ -39,9 +39,9 @@
public String getTypeName();
/**
- * Returns annotation type.
+ * Returns annotation type or null if it cannot be resolved.
*
- * @return annotation type
+ * @return annotation type or null if it cannot be resolved
*/
public IType getType();
/**
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2011-05-18 15:39:00 UTC (rev 31357)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2011-05-18 18:39:29 UTC (rev 31358)
@@ -80,13 +80,15 @@
}
public PackageDefinition getPackageDefinition() {
+ PackageDefinition result = null;
AbstractTypeDefinition t = getTypeDefinition();
- if(t == null) return null;
- String qn = t.getQualifiedName();
- if(qn == null) return null;
- int d = qn.lastIndexOf('.');
- String packageName = (d < 0) ? "" : qn.substring(0, d);
- return project.getDefinitions().getPackageDefinition(packageName);
+ if(t != null) {
+ String qn = t.getQualifiedName();
+ int d = qn.lastIndexOf('.');
+ String packageName = (d < 0) ? "" : qn.substring(0, d);
+ result = project.getDefinitions().getPackageDefinition(packageName);
+ }
+ return result;
}
protected void init(IType contextType, IRootDefinitionContext context, int flags) throws CoreException {
13 years, 4 months
JBoss Tools SVN: r31357 - trunk/build/parent.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-05-18 11:39:00 -0400 (Wed, 18 May 2011)
New Revision: 31357
Modified:
trunk/build/parent/pom.xml
Log:
turn on -Punified.site and -P jbosstools-nightly to make building easier (per Max)
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2011-05-18 15:09:56 UTC (rev 31356)
+++ trunk/build/parent/pom.xml 2011-05-18 15:39:00 UTC (rev 31357)
@@ -239,26 +239,6 @@
</issueManagement>
<profiles>
- <!-- Latest JBT nightly published update site (nightly builds) -->
- <profile>
- <id>jbosstools-nightly</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <repositories>
- <repository>
- <id>jbosstools-nightly</id>
- <url>${jbosstools-nightly}</url>
- <layout>p2</layout>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>true</enabled>
- </releases>
- </repository>
- </repositories>
- </profile>
<!-- Latest JBT work-in-progress component builds (CI builds), not yet pushed to the above nightly update site -->
<profile>
@@ -347,11 +327,6 @@
the unified.target file -->
<profile>
<id>unified.target</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <properties>
- </properties>
<build>
<plugins>
<plugin>
@@ -423,26 +398,6 @@
</repositories>
</profile>
- <!-- Single repo containing contents of unified.target, but without using the target file -->
- <profile>
- <id>unified.site</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <repositories>
- <repository>
- <id>jbosstools-target-site</id>
- <url>${jbosstools-target-site}</url>
- <layout>p2</layout>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>true</enabled>
- </releases>
- </repository>
- </repositories>
- </profile>
<profile>
<id>osx</id>
@@ -702,6 +657,33 @@
</profiles>
<repositories>
+
+ <!-- Single repo containing contents of unified.target, but without using the target file -->
+ <repository>
+ <id>jbosstools-target-site</id>
+ <url>${jbosstools-target-site}</url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+
+ <!-- Latest JBT nightly published update site (nightly builds) -->
+ <repository>
+ <id>jbosstools-nightly</id>
+ <url>${jbosstools-nightly}</url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
13 years, 4 months
JBoss Tools SVN: r31356 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-05-18 11:09:56 -0400 (Wed, 18 May 2011)
New Revision: 31356
Modified:
trunk/build/target-platform/unified.target.p2mirror.xml
Log:
add missing org.eclipse.persistence.jpa.feature.group
Modified: trunk/build/target-platform/unified.target.p2mirror.xml
===================================================================
--- trunk/build/target-platform/unified.target.p2mirror.xml 2011-05-18 15:07:11 UTC (rev 31355)
+++ trunk/build/target-platform/unified.target.p2mirror.xml 2011-05-18 15:09:56 UTC (rev 31356)
@@ -167,6 +167,7 @@
<iu id="org.eclipse.jpt.common.feature.feature.group" version=""/>
<iu id="org.eclipse.jpt.common.eclipselink.feature.feature.group" version=""/>
<iu id="org.eclipse.jpt.jpa.feature.feature.group" version=""/>
+<iu id="org.eclipse.persistence.jpa.feature.group" version=""/>
<iu id="org.eclipse.wst.common.fproj.feature.group" version=""/>
<iu id="org.eclipse.jst.enterprise_ui.feature.feature.group" version=""/>
<iu id="org.eclipse.wst.web_ui.feature.feature.group" version=""/>
13 years, 4 months
JBoss Tools SVN: r31355 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-05-18 11:07:11 -0400 (Wed, 18 May 2011)
New Revision: 31355
Modified:
trunk/build/target-platform/jbds.target
trunk/build/target-platform/jbds.target.p2mirror.xml
trunk/build/target-platform/multiple.target
trunk/build/target-platform/multiple.target.p2mirror.xml
trunk/build/target-platform/unified.target
Log:
add missing org.eclipse.persistence.jpa.feature.group
Modified: trunk/build/target-platform/jbds.target
===================================================================
--- trunk/build/target-platform/jbds.target 2011-05-18 12:27:31 UTC (rev 31354)
+++ trunk/build/target-platform/jbds.target 2011-05-18 15:07:11 UTC (rev 31355)
@@ -101,7 +101,7 @@
<unit id="org.eclipse.jpt.jpa.eclipselink.feature.feature.group" version="3.0.0.v201104180000-7J7F2F7RZHQPIlWAHbvaRg"/>
<unit id="org.eclipse.jpt.jpa.feature.feature.group" version="3.0.0.v201104050000-7Q7F77FBBoPaeQKbWRZaW6A"/>
-
+ <unit id="org.eclipse.persistence.jpa.feature.group" version="2.3.0.v20110429-r9282"/>
<unit id="org.eclipse.jsf.feature.feature.group" version="3.3.0.v201103022146-7E7IBtF9JgLWTM6WDPfRm"/>
<unit id="org.eclipse.jst.common.fproj.enablement.jdt.feature.group" version="3.3.0.v201102200555-377DF8s73543E5I5768"/>
<unit id="org.eclipse.jst.enterprise_core.feature.feature.group" version="3.3.0.v201102200555-52FO2AkF7B87QBM7X98"/>
@@ -166,4 +166,4 @@
<unit id="org.eclipse.tm.terminal.ssh.feature.group" version="2.1.0.v201103142315-30-7w312212153266"/>
</location>
</locations>
-</target>
+</target>
\ No newline at end of file
Modified: trunk/build/target-platform/jbds.target.p2mirror.xml
===================================================================
--- trunk/build/target-platform/jbds.target.p2mirror.xml 2011-05-18 12:27:31 UTC (rev 31354)
+++ trunk/build/target-platform/jbds.target.p2mirror.xml 2011-05-18 15:07:11 UTC (rev 31355)
@@ -88,6 +88,7 @@
<iu id="org.eclipse.jpt.common.eclipselink.feature.feature.group" version=""/>
<iu id="org.eclipse.jpt.jpa.eclipselink.feature.feature.group" version=""/>
<iu id="org.eclipse.jpt.jpa.feature.feature.group" version=""/>
+<iu id="org.eclipse.persistence.jpa.feature.group" version=""/>
<iu id="org.eclipse.jsf.feature.feature.group" version=""/>
<iu id="org.eclipse.jst.common.fproj.enablement.jdt.feature.group" version=""/>
<iu id="org.eclipse.jst.enterprise_core.feature.feature.group" version=""/>
Modified: trunk/build/target-platform/multiple.target
===================================================================
--- trunk/build/target-platform/multiple.target 2011-05-18 12:27:31 UTC (rev 31354)
+++ trunk/build/target-platform/multiple.target 2011-05-18 15:07:11 UTC (rev 31355)
@@ -199,6 +199,7 @@
<unit id="org.eclipse.jpt.common.feature.feature.group" version="1.0.0.v201104050000-6--AkF7BB7NCS7779"/>
<unit id="org.eclipse.jpt.common.eclipselink.feature.feature.group" version="1.0.0.v201104050000-3--8s73553B5F3333"/>
<unit id="org.eclipse.jpt.jpa.feature.feature.group" version="3.0.0.v201104050000-7Q7F77FBBoPaeQKbWRZaW6A"/>
+ <unit id="org.eclipse.persistence.jpa.feature.group" version="2.3.0.v20110429-r9282"/>
<unit id="org.eclipse.wst.common.fproj.feature.group" version="3.3.0.v201102150115-377DF8s7355397B4B9B"/>
<unit id="org.eclipse.jst.enterprise_ui.feature.feature.group" version="3.3.0.v201102200555-7b7IHxjFSK2WH7RH8SoSvIZz0TrSn"/>
<unit id="org.eclipse.wst.web_ui.feature.feature.group" version="3.3.0.v201102200555-7O7IFhJEMi9DyJcFJu7OrFtCGlwfv20b2SPz-ndB"/>
Modified: trunk/build/target-platform/multiple.target.p2mirror.xml
===================================================================
--- trunk/build/target-platform/multiple.target.p2mirror.xml 2011-05-18 12:27:31 UTC (rev 31354)
+++ trunk/build/target-platform/multiple.target.p2mirror.xml 2011-05-18 15:07:11 UTC (rev 31355)
@@ -167,6 +167,7 @@
<iu id="org.eclipse.jpt.common.feature.feature.group" version=""/>
<iu id="org.eclipse.jpt.common.eclipselink.feature.feature.group" version=""/>
<iu id="org.eclipse.jpt.jpa.feature.feature.group" version=""/>
+<iu id="org.eclipse.persistence.jpa.feature.group" version=""/>
<iu id="org.eclipse.wst.common.fproj.feature.group" version=""/>
<iu id="org.eclipse.jst.enterprise_ui.feature.feature.group" version=""/>
<iu id="org.eclipse.wst.web_ui.feature.feature.group" version=""/>
Modified: trunk/build/target-platform/unified.target
===================================================================
--- trunk/build/target-platform/unified.target 2011-05-18 12:27:31 UTC (rev 31354)
+++ trunk/build/target-platform/unified.target 2011-05-18 15:07:11 UTC (rev 31355)
@@ -199,6 +199,7 @@
<unit id="org.eclipse.jpt.common.feature.feature.group" version="1.0.0.v201104050000-6--AkF7BB7NCS7779"/>
<unit id="org.eclipse.jpt.common.eclipselink.feature.feature.group" version="1.0.0.v201104050000-3--8s73553B5F3333"/>
<unit id="org.eclipse.jpt.jpa.feature.feature.group" version="3.0.0.v201104050000-7Q7F77FBBoPaeQKbWRZaW6A"/>
+ <unit id="org.eclipse.persistence.jpa.feature.group" version="2.3.0.v20110429-r9282"/>
<unit id="org.eclipse.wst.common.fproj.feature.group" version="3.3.0.v201102150115-377DF8s7355397B4B9B"/>
<unit id="org.eclipse.jst.enterprise_ui.feature.feature.group" version="3.3.0.v201102200555-7b7IHxjFSK2WH7RH8SoSvIZz0TrSn"/>
<unit id="org.eclipse.wst.web_ui.feature.feature.group" version="3.3.0.v201102200555-7O7IFhJEMi9DyJcFJu7OrFtCGlwfv20b2SPz-ndB"/>
13 years, 4 months
JBoss Tools SVN: r31354 - trunk/module_template/docs/reference.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-05-18 08:27:31 -0400 (Wed, 18 May 2011)
New Revision: 31354
Modified:
trunk/module_template/docs/reference/README
Log:
updated with corect use of mvn commands
Modified: trunk/module_template/docs/reference/README
===================================================================
--- trunk/module_template/docs/reference/README 2011-05-18 10:27:26 UTC (rev 31353)
+++ trunk/module_template/docs/reference/README 2011-05-18 12:27:31 UTC (rev 31354)
@@ -3,10 +3,10 @@
MAVEN:
How to build everything:
- mvn install or mvn compile
+ mvn compile or mvn install
Just build html-single:
- mvn -Phtml-single install
+ mvn -Phtml-single compile
All profiles available: html-single, html, pdf, eclipse
13 years, 4 months
JBoss Tools SVN: r31353 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2: context and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-05-18 06:27:26 -0400 (Wed, 18 May 2011)
New Revision: 31353
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaIdMappingDefinition2_0.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaManyToManyMappingDefinition2_0.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaManyToOneMappingDefinition2_0.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaOneToOneMappingDefinition2_0.java
Log:
https://issues.jboss.org/browse/JBIDE-8947
Mode hibernate tools to Eclipse3.7M7
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaIdMappingDefinition2_0.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaIdMappingDefinition2_0.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaIdMappingDefinition2_0.java 2011-05-18 10:27:26 UTC (rev 31353)
@@ -0,0 +1,68 @@
+package org.jboss.tools.hibernate.jpt.core.internal.jpa2.context.definition;
+
+import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
+import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
+import org.jboss.tools.hibernate.jpt.core.internal.context.definition.HibernateJavaIdMappingDefinition;
+
+public class HibernateJavaIdMappingDefinition2_0 extends JavaAttributeMappingDefinitionWrapper {
+
+ private static final HibernateJavaIdMappingDefinition DELEGATE = HibernateJavaIdMappingDefinition.instance();
+
+ // singleton
+ private static final HibernateJavaIdMappingDefinition2_0 INSTANCE = new HibernateJavaIdMappingDefinition2_0();
+
+ /**
+ * Return the singleton.
+ */
+ public static HibernateJavaIdMappingDefinition2_0 instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Enforce singleton usage
+ */
+ private HibernateJavaIdMappingDefinition2_0() {
+ super();
+ }
+
+
+ @Override
+ protected JavaAttributeMappingDefinition getDelegate() {
+ return DELEGATE;
+ }
+
+ /**
+ * The annotation is "specified" only if it is not "derived" (i.e.
+ * accompanied by a M-1 or 1-1 annotation).
+ */
+ @Override
+ public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
+ boolean idSpecified = super.isSpecified(persistentAttribute);
+ return idSpecified && ! this.isDerivedId(persistentAttribute);
+ }
+
+ /**
+ * Return whether the specified attribute's <code>Id</code> annotation is
+ * a supporting annotation for M-1 or 1-1 mapping, as opposed to a primary
+ * mapping annotation.
+ * <p>
+ * This might produce confusing behavior if the annotations look something
+ * like:<pre>
+ * @Id @Basic @ManyToOne private int foo;
+ * </pre>
+ */
+ private boolean isDerivedId(JavaPersistentAttribute persistentAttribute) {
+ return this.attributeHasManyToOneMapping(persistentAttribute) ||
+ this.attributeHasOneToOneMapping(persistentAttribute);
+ }
+
+ private boolean attributeHasManyToOneMapping(JavaPersistentAttribute persistentAttribute) {
+ return HibernateJavaManyToOneMappingDefinition2_0.instance().isSpecified(persistentAttribute);
+ }
+
+ private boolean attributeHasOneToOneMapping(JavaPersistentAttribute persistentAttribute) {
+ return HibernateJavaOneToOneMappingDefinition2_0.instance().isSpecified(persistentAttribute);
+ }
+
+}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaManyToManyMappingDefinition2_0.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaManyToManyMappingDefinition2_0.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaManyToManyMappingDefinition2_0.java 2011-05-18 10:27:26 UTC (rev 31353)
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.jpa2.context.definition;
+
+import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
+import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
+import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
+import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyClass2_0Annotation;
+import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
+import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
+import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation;
+import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyJoinColumns2_0Annotation;
+import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
+import org.eclipse.jpt.jpa.core.jpa2.resource.java.OrderColumn2_0Annotation;
+import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
+import org.eclipse.jpt.jpa.core.resource.java.AttributeOverridesAnnotation;
+import org.jboss.tools.hibernate.jpt.core.internal.context.definition.HibernateJavaManyToManyMappingDefinition;
+
+/**
+ *
+ * @author Dmitry Geraskov (geraskov(a)gmail.com)
+ *
+ */
+public class HibernateJavaManyToManyMappingDefinition2_0 extends JavaAttributeMappingDefinitionWrapper
+{
+ private static final JavaAttributeMappingDefinition DELEGATE = HibernateJavaManyToManyMappingDefinition.instance();
+
+ // singleton
+ private static final JavaAttributeMappingDefinition INSTANCE = new HibernateJavaManyToManyMappingDefinition2_0();
+
+ /**
+ * Return the singleton.
+ */
+ public static JavaAttributeMappingDefinition instance() {
+ return INSTANCE;
+ }
+
+
+ /**
+ * Enforce singleton usage
+ */
+ private HibernateJavaManyToManyMappingDefinition2_0() {
+ super();
+ }
+
+ @Override
+ protected JavaAttributeMappingDefinition getDelegate() {
+ return DELEGATE;
+ }
+
+ @Override
+ public Iterable<String> getSupportingAnnotationNames() {
+ return COMBINED_SUPPORTING_ANNOTATION_NAMES;
+ }
+
+ public static final String[] SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0 = new String[] {
+ AttributeOverrideAnnotation.ANNOTATION_NAME,
+ AttributeOverridesAnnotation.ANNOTATION_NAME,
+ MapKeyClass2_0Annotation.ANNOTATION_NAME,
+ MapKeyColumn2_0Annotation.ANNOTATION_NAME,
+ MapKeyEnumerated2_0Annotation.ANNOTATION_NAME,
+ MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME,
+ MapKeyJoinColumns2_0Annotation.ANNOTATION_NAME,
+ MapKeyTemporal2_0Annotation.ANNOTATION_NAME,
+ OrderColumn2_0Annotation.ANNOTATION_NAME
+ };
+ private static final Iterable<String> SUPPORTING_ANNOTATION_NAMES_2_0 = new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0);
+
+ @SuppressWarnings("unchecked")
+ private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
+ DELEGATE.getSupportingAnnotationNames(),
+ SUPPORTING_ANNOTATION_NAMES_2_0
+ );
+}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaManyToOneMappingDefinition2_0.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaManyToOneMappingDefinition2_0.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaManyToOneMappingDefinition2_0.java 2011-05-18 10:27:26 UTC (rev 31353)
@@ -0,0 +1,55 @@
+package org.jboss.tools.hibernate.jpt.core.internal.jpa2.context.definition;
+
+import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
+import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
+import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
+import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapsId2_0Annotation;
+import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
+import org.jboss.tools.hibernate.jpt.core.internal.context.definition.HibernateJavaManyToOneMappingDefinition;
+
+public class HibernateJavaManyToOneMappingDefinition2_0 extends JavaAttributeMappingDefinitionWrapper
+{
+ private static final JavaAttributeMappingDefinition DELEGATE = HibernateJavaManyToOneMappingDefinition.instance();
+
+ // singleton
+ private static final JavaAttributeMappingDefinition INSTANCE = new HibernateJavaManyToOneMappingDefinition2_0();
+
+ /**
+ * Return the singleton.
+ */
+ public static JavaAttributeMappingDefinition instance() {
+ return INSTANCE;
+ }
+
+
+ /**
+ * Enforce singleton usage
+ */
+ private HibernateJavaManyToOneMappingDefinition2_0() {
+ super();
+ }
+
+ @Override
+ protected JavaAttributeMappingDefinition getDelegate() {
+ return DELEGATE;
+ }
+
+ @Override
+ public Iterable<String> getSupportingAnnotationNames() {
+ return COMBINED_SUPPORTING_ANNOTATION_NAMES;
+ }
+
+ public static final String[] SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0 = new String[] {
+ IdAnnotation.ANNOTATION_NAME,
+ MapsId2_0Annotation.ANNOTATION_NAME
+ };
+ private static final Iterable<String> SUPPORTING_ANNOTATION_NAMES_2_0 = new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0);
+
+ @SuppressWarnings("unchecked")
+ private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
+ DELEGATE.getSupportingAnnotationNames(),
+ SUPPORTING_ANNOTATION_NAMES_2_0
+ );
+
+}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaOneToOneMappingDefinition2_0.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaOneToOneMappingDefinition2_0.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/context/definition/HibernateJavaOneToOneMappingDefinition2_0.java 2011-05-18 10:27:26 UTC (rev 31353)
@@ -0,0 +1,55 @@
+package org.jboss.tools.hibernate.jpt.core.internal.jpa2.context.definition;
+
+import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
+import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
+import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
+import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapsId2_0Annotation;
+import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
+import org.jboss.tools.hibernate.jpt.core.internal.context.definition.HibernateJavaOneToOneMappingDefinition;
+
+public class HibernateJavaOneToOneMappingDefinition2_0 extends JavaAttributeMappingDefinitionWrapper
+{
+ private static final JavaAttributeMappingDefinition DELEGATE = HibernateJavaOneToOneMappingDefinition.instance();
+
+ // singleton
+ private static final JavaAttributeMappingDefinition INSTANCE = new HibernateJavaOneToOneMappingDefinition2_0();
+
+ /**
+ * Return the singleton.
+ */
+ public static JavaAttributeMappingDefinition instance() {
+ return INSTANCE;
+ }
+
+
+ /**
+ * Enforce singleton usage
+ */
+ private HibernateJavaOneToOneMappingDefinition2_0() {
+ super();
+ }
+
+ @Override
+ protected JavaAttributeMappingDefinition getDelegate() {
+ return DELEGATE;
+ }
+
+ @Override
+ public Iterable<String> getSupportingAnnotationNames() {
+ return COMBINED_SUPPORTING_ANNOTATION_NAMES;
+ }
+
+ public static final String[] SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0 = new String[] {
+ IdAnnotation.ANNOTATION_NAME,
+ MapsId2_0Annotation.ANNOTATION_NAME
+ };
+ private static final Iterable<String> SUPPORTING_ANNOTATION_NAMES_2_0 = new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0);
+
+ @SuppressWarnings("unchecked")
+ private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
+ DELEGATE.getSupportingAnnotationNames(),
+ SUPPORTING_ANNOTATION_NAMES_2_0
+ );
+}
+
13 years, 4 months