mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
In version 13.22 if the entity definition is in a different package, the generated query bean cannot resolve the symbol erro
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package org.example.domain;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import org.example.domain.other.OtherBean;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Entity
|
||||
public class OtherMain {
|
||||
|
||||
@Id
|
||||
long id;
|
||||
|
||||
@ManyToOne
|
||||
OtherBean other;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package org.example.domain.other;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Entity
|
||||
public class OtherBean {
|
||||
|
||||
@Id
|
||||
long id;
|
||||
String name;
|
||||
}
|
||||
+2
-1
@@ -362,7 +362,8 @@ class ProcessingContext implements Constants {
|
||||
private PropertyType createPropertyTypeAssoc(String fullName) {
|
||||
String[] split = Split.split(fullName);
|
||||
String propertyName = "Q" + split[1] + ".Assoc";
|
||||
return new PropertyTypeAssoc(propertyName);
|
||||
String importName = split[0] + ".query.Q" + split[1];
|
||||
return new PropertyTypeAssoc(propertyName, importName);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+6
-2
@@ -7,13 +7,17 @@ import java.util.Set;
|
||||
*/
|
||||
class PropertyTypeAssoc extends PropertyType {
|
||||
|
||||
private final String importName;
|
||||
|
||||
/**
|
||||
* Construct given the associated bean type name and package.
|
||||
*
|
||||
* @param qAssocTypeName the associated bean type name.
|
||||
* @param importName the import for the Assoc bean.
|
||||
*/
|
||||
PropertyTypeAssoc(String qAssocTypeName) {
|
||||
PropertyTypeAssoc(String qAssocTypeName, String importName) {
|
||||
super(qAssocTypeName);
|
||||
this.importName = importName;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -21,7 +25,7 @@ class PropertyTypeAssoc extends PropertyType {
|
||||
*/
|
||||
@Override
|
||||
void addImports(Set<String> allImports) {
|
||||
// do nothing
|
||||
allImports.add(importName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user