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) { |
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; |
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; |
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) { |
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) { |
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; | |
} |
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; |
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; |
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; |
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 [email protected] font-awesome | |
3. Add the lines below in scripts array at angular.json |
NewerOlder