mercredi 28 juillet 2021

*** annotation LOMBOK *** replacing getters and setters methods

 *** annotation LOMBOK ***

in IntelliJ : install the plugin lombok
in project pom.xml : add the dependency
in Entity add those annotations
@Entity
@Data @NoArgsConstructor @AllArgsConstructor @ToString

and we have not need to add Setters, Getters, and Constructors methods

mardi 27 juillet 2021

@ManyToOne and @OneToOne relations with @EmbeddedId

******************************

*** @ManyToOne and @OneToOne relations with @EmbeddedId

******************************


@Entity

public class Bons implements Serializable {


@EmbeddedId

private BonsKey id;

...

}

@Embeddable

public class BonsKey implements Serializable {


@ManyToOne

@JoinColumn(name = "CODE_PRESTATAIRE")

private Prestataires prestataire;

@ManyToOne

@JoinColumn(name = "NUM_SERVICE")

private ServicesDossiers serviceDossier;

...

}

@Entity

public class Communications implements Serializable{


@Id @GeneratedValue

@Column(name="CODE_COMMUNICATION")

private Long codeCommunication;



@ManyToOne

@JoinColumns({

@JoinColumn(name="BON_CODE_PRESTATAIRE", nullable = true),

@JoinColumn(name="BON_NUM_SERVICE",nullable = true)

})

private Bons bonId;

} 

lundi 26 juillet 2021

GIT install Config

1- Download GIT Installer from https://git-scm.com/downloads

2- Configure username and Email

$ git config --global user.name "Mohamed AMINE OSMAN"

$ git config --global user.email "medamine.osman@apus-consulting.tn"

3- Create the first Git Repository

$ git init first_project

$ cd first_project

create file1.txt

$ git add file1.txt

$ git commit -m "this is my first commit"

4- Edit your setting

$ git config --list --show-origin