Skip to content
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.

Commit

Permalink
#53 - BeanNotRegisteredException: Could not find BeanDescriptor for c…
Browse files Browse the repository at this point in the history
…lass demo.entity.embed.Certificate. Perhaps the EmbeddedId class is not registered?
  • Loading branch information
rbygrave committed Apr 6, 2020
1 parent 3e592e9 commit d6a3b43
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ boolean isEntity(Element element) {
return hasAnnotations(element, ENTITY);
}

boolean isEmbeddable(Element element) {
return hasAnnotations(element, EMBEDDABLE);
}

/**
* Find the DbName annotation and return name if found.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class SimpleQueryBeanWriter {
private final String dbName;
private final String beanFullName;
private final boolean isEntity;
private final boolean embeddable;
private boolean writingAssocBean;

private String destPackage;
Expand All @@ -44,6 +45,7 @@ class SimpleQueryBeanWriter {
this.destPackage = derivePackage(beanFullName) + ".query";
this.shortName = deriveShortName(beanFullName);
this.isEntity = processingContext.isEntity(element);
this.embeddable = processingContext.isEmbeddable(element);
this.dbName = findDbName();
}

Expand All @@ -55,6 +57,10 @@ private boolean isEntity() {
return isEntity;
}

private boolean isEmbeddable() {
return embeddable;
}

private void gatherPropertyDetails() {
final String generated = processingContext.getGeneratedAnnotation();
if (generated != null) {
Expand Down Expand Up @@ -96,8 +102,9 @@ private void addClassProperties() {
void writeRootBean() throws IOException {

gatherPropertyDetails();

if (isEntity()) {
if (isEmbeddable()) {
processingContext.addEntity(beanFullName, dbName);
} else if (isEntity()) {
processingContext.addEntity(beanFullName, dbName);
writer = new Append(createFileWriter());

Expand Down Expand Up @@ -316,7 +323,7 @@ private void writeClass() {
writer.eol();
}

private void writeAlias() {
private void writeAlias() {
if (!writingAssocBean) {
writer.append(" private static final Q%s _alias = new Q%1$s(true);", shortName).eol().eol();

Expand Down

0 comments on commit d6a3b43

Please sign in to comment.