Search in sources :

Example 11 with PhysicalTypeMetadata

use of org.springframework.roo.classpath.PhysicalTypeMetadata in project spring-roo by spring-projects.

the class DbreDatabaseListenerImpl method isIdentifierDeletable.

private boolean isIdentifierDeletable(final JavaType identifierType) {
    final PhysicalTypeMetadata governorPhysicalTypeMetadata = getPhysicalTypeMetadata(identifierType);
    if (governorPhysicalTypeMetadata == null) {
        return false;
    }
    // Check for added constructors, fields and methods
    final ClassOrInterfaceTypeDetails managedIdentifier = governorPhysicalTypeMetadata.getMemberHoldingTypeDetails();
    return managedIdentifier.getDeclaredConstructors().isEmpty() && managedIdentifier.getDeclaredFields().isEmpty() && managedIdentifier.getDeclaredMethods().isEmpty();
}
Also used : PhysicalTypeMetadata(org.springframework.roo.classpath.PhysicalTypeMetadata) ClassOrInterfaceTypeDetails(org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetails)

Aggregations

PhysicalTypeMetadata (org.springframework.roo.classpath.PhysicalTypeMetadata)11 ClassOrInterfaceTypeDetails (org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetails)7 JavaType (org.springframework.roo.model.JavaType)5 JavaSymbolName (org.springframework.roo.model.JavaSymbolName)4 MemberDetails (org.springframework.roo.classpath.scanner.MemberDetails)3 ArrayList (java.util.ArrayList)2 PhysicalTypeDetails (org.springframework.roo.classpath.PhysicalTypeDetails)2 FieldMetadata (org.springframework.roo.classpath.details.FieldMetadata)2 MethodMetadata (org.springframework.roo.classpath.details.MethodMetadata)2 AnnotationMetadata (org.springframework.roo.classpath.details.annotations.AnnotationMetadata)2 EmbeddedField (org.springframework.roo.classpath.operations.jsr303.EmbeddedField)2 JdkJavaType (org.springframework.roo.model.JdkJavaType)2 ImportDeclaration (com.github.antlrjavaparser.api.ImportDeclaration)1 BodyDeclaration (com.github.antlrjavaparser.api.body.BodyDeclaration)1 ClassOrInterfaceDeclaration (com.github.antlrjavaparser.api.body.ClassOrInterfaceDeclaration)1 ConstructorDeclaration (com.github.antlrjavaparser.api.body.ConstructorDeclaration)1 EnumConstantDeclaration (com.github.antlrjavaparser.api.body.EnumConstantDeclaration)1 EnumDeclaration (com.github.antlrjavaparser.api.body.EnumDeclaration)1 FieldDeclaration (com.github.antlrjavaparser.api.body.FieldDeclaration)1 MethodDeclaration (com.github.antlrjavaparser.api.body.MethodDeclaration)1