Max
Max
Explore posts from servers
JCHJava Community | Help. Code. Learn.
Created by Max on 2/9/2025 in #java-help
Intellij Idea bug
Hello, currently I am working on a big project, I was on vscode but I just switched to Intellij Idea Ultimate however I found several errors: I'm on WSL and Docker in a project with DevContainer, I often have problems with "Host is unresponsive", Dump Threads, and others which create lag. Then I notice that I cannot build my pom.xml from the IDE, no problem, I do it in cmd but I notice that all the packages are found except Lombok. I tried to clean install but nothing changes. Could anyone help me resolve my issues?
20 replies
JCHJava Community | Help. Code. Learn.
Created by Max on 4/5/2024 in #java-help
Could not determine recommended JdbcType for <class>
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Could not determine recommended JdbcType for `fr.mind.mind.models.item.ItemCosmetic
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Could not determine recommended JdbcType for `fr.mind.mind.models.item.ItemCosmetic
@Entity
@Table
@Getter
@Setter
@NoArgsConstructor
public class ItemCosmetic {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(nullable = true)
private Integer series;
@Column(nullable = true)
private String phoneNumber;
@ManyToOne(cascade = CascadeType.DETACH)
@JoinColumn(name = "buyerId", nullable = true)
@JsonProperty("buyerId")
@Getter(AccessLevel.NONE)
private Player buyer;
@ManyToOne(cascade = CascadeType.DETACH)
@JoinColumn(name = "itemId", nullable = true)
private Item item;
@Column(nullable = true)
private String renamed;
@Column(nullable = false)
private int quantity = 1;
@Column(nullable = false)
private boolean isDrop = false;
@ManyToOne(cascade = CascadeType.DETACH)
@JoinColumn(name = "inventoryId", nullable = true, unique = false)
private Inventory inventory;

public int getBuyerId() {
return buyer.getId();
}

public ItemCosmetic(
Player buyer,
Item item,
Inventory inventory) {
this.buyer = buyer;
this.item = item;
this.inventory = inventory;
}

public ItemCosmetic(
Player buyer,
Item item,
int quantity,
Inventory inventory) {
this.buyer = buyer;
this.item = item;
this.quantity = quantity;
this.inventory = inventory;
}
}
@Entity
@Table
@Getter
@Setter
@NoArgsConstructor
public class ItemCosmetic {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(nullable = true)
private Integer series;
@Column(nullable = true)
private String phoneNumber;
@ManyToOne(cascade = CascadeType.DETACH)
@JoinColumn(name = "buyerId", nullable = true)
@JsonProperty("buyerId")
@Getter(AccessLevel.NONE)
private Player buyer;
@ManyToOne(cascade = CascadeType.DETACH)
@JoinColumn(name = "itemId", nullable = true)
private Item item;
@Column(nullable = true)
private String renamed;
@Column(nullable = false)
private int quantity = 1;
@Column(nullable = false)
private boolean isDrop = false;
@ManyToOne(cascade = CascadeType.DETACH)
@JoinColumn(name = "inventoryId", nullable = true, unique = false)
private Inventory inventory;

public int getBuyerId() {
return buyer.getId();
}

public ItemCosmetic(
Player buyer,
Item item,
Inventory inventory) {
this.buyer = buyer;
this.item = item;
this.inventory = inventory;
}

public ItemCosmetic(
Player buyer,
Item item,
int quantity,
Inventory inventory) {
this.buyer = buyer;
this.item = item;
this.quantity = quantity;
this.inventory = inventory;
}
}
79 replies
DIAdiscord.js - Imagine an app
Created by Max on 7/28/2023 in #djs-questions
ActionRowBuilder type in interaction.reply component
Hello, I'm creating a typescript discord handler and want to try the buttons, however I have a typing error. I looked at the doc and it's well written. Do you have a solution to my problem? note: the CommandContext is the same as the ChatInputInteractionCommand, but with additional methods, the reply method is a copy with the same options as in the package.
execute(client: ExtendsClient, ctx: CommandContext) {
const click = new ButtonBuilder()
.setCustomId("btn1")
.setLabel("Click")
.setStyle(ButtonStyle.Primary)

const row = new ActionRowBuilder()
.addComponents(click);
ctx.reply({content: "Click sur le bouton pour essayer l'event :", components: [row]})
}
execute(client: ExtendsClient, ctx: CommandContext) {
const click = new ButtonBuilder()
.setCustomId("btn1")
.setLabel("Click")
.setStyle(ButtonStyle.Primary)

const row = new ActionRowBuilder()
.addComponents(click);
ctx.reply({content: "Click sur le bouton pour essayer l'event :", components: [row]})
}
Type 'ActionRowBuilder<AnyComponentBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<...>'.
Property 'type' is missing in type 'ActionRowBuilder<AnyComponentBuilder>' but required in type 'ActionRowData<MessageActionRowComponentBuilder | MessageActionRowComponentData>'.
Type 'ActionRowBuilder<AnyComponentBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<...>'.
Property 'type' is missing in type 'ActionRowBuilder<AnyComponentBuilder>' but required in type 'ActionRowData<MessageActionRowComponentBuilder | MessageActionRowComponentData>'.
8 replies
JCHJava Community | Help. Code. Learn.
Created by Max on 6/1/2023 in #java-help
Get all classes with a specific annotation
Hey, I would like to get all the classes having an annotation named: "Command". Make sure not to have indicated the "commands" package if possible. My project would be to make a kind of commandHandler which will load all the commands in a map. - @ Command
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Command {
String name();
}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Command {
String name();
}
- Command Help
@Command(name = "help")
public class HelpCommand implements CommandRunner {

@Override
public void run(ArgumentParser parser, Subparsers subparsers) {
parser.printHelp();
}
}
@Command(name = "help")
public class HelpCommand implements CommandRunner {

@Override
public void run(ArgumentParser parser, Subparsers subparsers) {
parser.printHelp();
}
}
7 replies
DIAdiscord.js - Imagine an app
Created by Max on 1/14/2023 in #djs-questions
error undefined slash cmd
10 replies