Skip to content

Commit

Permalink
Merge branch 'release/2022-12'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-gomes committed Jan 19, 2023
2 parents 4961e98 + f21c867 commit 85c6bb9
Show file tree
Hide file tree
Showing 703 changed files with 790,952 additions and 761,379 deletions.
7 changes: 6 additions & 1 deletion app/dao/impl/jpa/JpaDataDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ protected static <D extends Data> D resolve(D data, Class<D> clazz) {
protected static List<Class<?>> SUPPORTED_PRIMITIVE_CONSTRAINT_CLASSES = Arrays.asList(
Number.class,
Boolean.class,
String.class
String.class,
UUID.class
);

@SuppressWarnings({"unchecked", "rawtypes"})
Expand Down Expand Up @@ -232,6 +233,10 @@ else if (constraint instanceof PrimitiveConstraint) {
Object actualValue;
Object constrainedValue;
switch (primitiveConstraint.getProperty()) {
case "@id":
actualValue = data.getId();
constrainedValue = JavaBeanHelper.convert(primitiveConstraint.getValue(), UUID.class);
break;
case "@type":
try {
Class<?> clazz = data instanceof HibernateProxy ?
Expand Down
15 changes: 11 additions & 4 deletions app/javabean/JavaBeanHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@
import java.beans.*;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;

public class JavaBeanHelper {

public static Map<String, PropertyDescriptor> getBeanProperties(Object bean) {
try {
return Arrays.stream(Introspector.getBeanInfo(bean.getClass(), Object.class).getPropertyDescriptors())
Expand Down Expand Up @@ -66,7 +64,16 @@ public static Map<Method, Method> getBeanGettersSetters(Object bean) {
@SuppressWarnings("unchecked")
public static <C> C convert(String text, Class<C> targetType) {
PropertyEditor editor = PropertyEditorManager.findEditor(targetType);
if (editor == null) {
if (UUID.class.equals(targetType)) {
PropertyEditorManager.registerEditor(UUID.class, UuidPropertyEditor.class);
editor = PropertyEditorManager.findEditor(UUID.class);
} else {
return null;
}
}
editor.setAsText(text);
return (C) editor.getValue();
}

}
12 changes: 12 additions & 0 deletions app/javabean/UuidPropertyEditor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package javabean;

import java.beans.PropertyEditorSupport;
import java.util.UUID;

public class UuidPropertyEditor extends PropertyEditorSupport {

@Override
public void setAsText(String text) throws IllegalArgumentException {
setValue(UUID.fromString(text));
}
}
6 changes: 4 additions & 2 deletions app/org/omg/sysml/metamodel/Element.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ public interface Element extends SysMLType {

List<? extends String> getAliasIds();

String getDeclaredShortName();

String getDeclaredName();

String getShortName();

String getName();

String getEffectiveName();

String getQualifiedName();

Boolean getIsImpliedIncluded();
Expand Down
2 changes: 2 additions & 0 deletions app/org/omg/sysml/metamodel/EventOccurrenceUsage.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@

public interface EventOccurrenceUsage extends OccurrenceUsage, SysMLType {
OccurrenceUsage getEventOccurrence();

Boolean getIsReference();
}
2 changes: 1 addition & 1 deletion app/org/omg/sysml/metamodel/LifeClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
import java.util.Set;

public interface LifeClass extends Class, SysMLType {

Boolean getIsSufficient();
}
60 changes: 40 additions & 20 deletions app/org/omg/sysml/metamodel/impl/AcceptActionUsageImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,42 @@ public void setChainingFeature(List<Feature> chainingFeature) {



// @info.archinnov.achilles.annotations.Column("declaredName")
private String declaredName;

@JsonGetter
@Lob
@org.hibernate.annotations.Type(type = "org.hibernate.type.TextType")
@javax.persistence.Column(name = "declaredName", table = "AcceptActionUsage")
public String getDeclaredName() {
return declaredName;
}

@JsonSetter
public void setDeclaredName(String declaredName) {
this.declaredName = declaredName;
}



// @info.archinnov.achilles.annotations.Column("declaredShortName")
private String declaredShortName;

@JsonGetter
@Lob
@org.hibernate.annotations.Type(type = "org.hibernate.type.TextType")
@javax.persistence.Column(name = "declaredShortName", table = "AcceptActionUsage")
public String getDeclaredShortName() {
return declaredShortName;
}

@JsonSetter
public void setDeclaredShortName(String declaredShortName) {
this.declaredShortName = declaredShortName;
}



// @info.archinnov.achilles.annotations.Transient
// @info.archinnov.achilles.annotations.Column("definition")
private List<Classifier> definition;
Expand Down Expand Up @@ -319,26 +355,6 @@ public void setDocumentation(List<Documentation> documentation) {



// @info.archinnov.achilles.annotations.Transient
// @info.archinnov.achilles.annotations.Column("effectiveName")
private String effectiveName;

@JsonGetter
@Lob
@org.hibernate.annotations.Type(type = "org.hibernate.type.TextType")
// @javax.persistence.Transient
@javax.persistence.Column(name = "effectiveName", table = "AcceptActionUsage")
public String getEffectiveName() {
return effectiveName;
}

@JsonSetter
public void setEffectiveName(String effectiveName) {
this.effectiveName = effectiveName;
}



// @info.archinnov.achilles.annotations.Column("elementId")
private java.util.UUID elementId;

Expand Down Expand Up @@ -950,12 +966,14 @@ public void setMultiplicity(Multiplicity multiplicity) {



// @info.archinnov.achilles.annotations.Transient
// @info.archinnov.achilles.annotations.Column("name")
private String name;

@JsonGetter
@Lob
@org.hibernate.annotations.Type(type = "org.hibernate.type.TextType")
// @javax.persistence.Transient
@javax.persistence.Column(name = "name", table = "AcceptActionUsage")
public String getName() {
return name;
Expand Down Expand Up @@ -2596,12 +2614,14 @@ public void setReceiverArgument(Expression receiverArgument) {



// @info.archinnov.achilles.annotations.Transient
// @info.archinnov.achilles.annotations.Column("shortName")
private String shortName;

@JsonGetter
@Lob
@org.hibernate.annotations.Type(type = "org.hibernate.type.TextType")
// @javax.persistence.Transient
@javax.persistence.Column(name = "shortName", table = "AcceptActionUsage")
public String getShortName() {
return shortName;
Expand Down
60 changes: 40 additions & 20 deletions app/org/omg/sysml/metamodel/impl/ActionDefinitionImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,42 @@ public void setAliasIds(List<String> aliasIds) {



// @info.archinnov.achilles.annotations.Column("declaredName")
private String declaredName;

@JsonGetter
@Lob
@org.hibernate.annotations.Type(type = "org.hibernate.type.TextType")
@javax.persistence.Column(name = "declaredName", table = "ActionDefinition")
public String getDeclaredName() {
return declaredName;
}

@JsonSetter
public void setDeclaredName(String declaredName) {
this.declaredName = declaredName;
}



// @info.archinnov.achilles.annotations.Column("declaredShortName")
private String declaredShortName;

@JsonGetter
@Lob
@org.hibernate.annotations.Type(type = "org.hibernate.type.TextType")
@javax.persistence.Column(name = "declaredShortName", table = "ActionDefinition")
public String getDeclaredShortName() {
return declaredShortName;
}

@JsonSetter
public void setDeclaredShortName(String declaredShortName) {
this.declaredShortName = declaredShortName;
}



// @info.archinnov.achilles.annotations.Transient
// @info.archinnov.achilles.annotations.Column("differencingType")
private List<Type> differencingType;
Expand Down Expand Up @@ -223,26 +259,6 @@ public void setDocumentation(List<Documentation> documentation) {



// @info.archinnov.achilles.annotations.Transient
// @info.archinnov.achilles.annotations.Column("effectiveName")
private String effectiveName;

@JsonGetter
@Lob
@org.hibernate.annotations.Type(type = "org.hibernate.type.TextType")
// @javax.persistence.Transient
@javax.persistence.Column(name = "effectiveName", table = "ActionDefinition")
public String getEffectiveName() {
return effectiveName;
}

@JsonSetter
public void setEffectiveName(String effectiveName) {
this.effectiveName = effectiveName;
}



// @info.archinnov.achilles.annotations.Column("elementId")
private java.util.UUID elementId;

Expand Down Expand Up @@ -677,12 +693,14 @@ public void setMultiplicity(Multiplicity multiplicity) {



// @info.archinnov.achilles.annotations.Transient
// @info.archinnov.achilles.annotations.Column("name")
private String name;

@JsonGetter
@Lob
@org.hibernate.annotations.Type(type = "org.hibernate.type.TextType")
// @javax.persistence.Transient
@javax.persistence.Column(name = "name", table = "ActionDefinition")
public String getName() {
return name;
Expand Down Expand Up @@ -1960,12 +1978,14 @@ public void setQualifiedName(String qualifiedName) {



// @info.archinnov.achilles.annotations.Transient
// @info.archinnov.achilles.annotations.Column("shortName")
private String shortName;

@JsonGetter
@Lob
@org.hibernate.annotations.Type(type = "org.hibernate.type.TextType")
// @javax.persistence.Transient
@javax.persistence.Column(name = "shortName", table = "ActionDefinition")
public String getShortName() {
return shortName;
Expand Down
Loading

0 comments on commit 85c6bb9

Please sign in to comment.