Created
March 28, 2021 19:21
-
-
Save evrentan/db523b0b09c5953ee3534d630d9adfce to your computer and use it in GitHub Desktop.
Entity Definition with Panache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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