Skip to content

Instantly share code, notes, and snippets.

@evrentan
Created March 28, 2021 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evrentan/db523b0b09c5953ee3534d630d9adfce to your computer and use it in GitHub Desktop.
Save evrentan/db523b0b09c5953ee3534d630d9adfce to your computer and use it in GitHub Desktop.
Entity Definition with Panache
package com.tan.example.entity;
import io.quarkus.mongodb.panache.MongoEntity;
import io.quarkus.mongodb.panache.PanacheMongoEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
@MongoEntity(collection = "enterprise")
public class EnterpriseEntity extends PanacheMongoEntity {
@NotNull
@Size(min = 3, max = 50)
public String name;
public String webPage;
@Override
public String toString() {
return "EnterpriseEntity{" +
"id='" + id + '\'' +
", name='" + name + '\'' +
", webPage='" + webPage + '\'' +
'}';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment