View GenderConverter.java
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
@Converter | |
public class GenderConverter implements AttributeConverter<Gender, String> { | |
@Override | |
public String convertToDatabaseColumn(Gender gender) { | |
return gender.getCode(); | |
} | |
@Override | |
public Gender convertToEntityAttribute(String code) { |
View Person.java
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
@Entity | |
public class Person { | |
@Id | |
private Long id; | |
private String firstName; | |
private String lastName; | |
@Convert(converter = GenderConverter.class) | |
private Gender gender; |
View Gender.java
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
public enum Gender { | |
FEMALE("F"), | |
MALE("M"), | |
NOT_AVAILABLE("N"); | |
private final String code; | |
Gender(String code) { | |
this.code = code; |
View GenderConverter.java
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
@Converter | |
public class GenderConverter implements AttributeConverter<Gender, String> { | |
@Override | |
public String convertToDatabaseColumn(Gender gender) { | |
return gender.getCode(); | |
} | |
@Override | |
public Gender convertToEntityAttribute(String code) { |
View GenderConverter.java
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
@Converter(autoApply = true) | |
public class GenderConverter implements AttributeConverter<Gender, String> { | |
@Override | |
public String convertToDatabaseColumn(Gender gender) { | |
return gender.getCode(); | |
} | |
@Override | |
public Gender convertToEntityAttribute(String code) { |
View Gender.java
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
public enum Gender { | |
FEMALE, | |
MALE, | |
NOT_AVAILABLE; | |
} |
View Person.java
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
@Entity | |
public class Person { | |
@Id | |
private Long id; | |
private String firstName; | |
private String lastName; | |
@Enumerated(EnumType.STRING) | |
private Gender gender; |
View DemoApplication.java
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.example.demo; | |
import lombok.AllArgsConstructor; | |
import lombok.Data; | |
import lombok.NoArgsConstructor; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; |
View LiquibaseGeneratorForFormulierOnderdeel.java
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 be.schaubroeck.golf.liquibase.corrections; | |
import org.apache.commons.io.FileUtils; | |
import org.apache.commons.lang3.text.StrSubstitutor; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.util.HashMap; |
View gist:890c5d76e84de91d52a9f88df0965588
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
1. Create angular project | |
ng new my-app | |
2. Install bootstrap dependencies | |
npm install --save @ng-bootstrap/ng-bootstrap bootstrap@4.1.3 font-awesome | |
3. Add the lines below in scripts array at angular.json |
NewerOlder