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.knoldus.user.annotation; | |
import javax.validation.ConstraintValidator; | |
import javax.validation.ConstraintValidatorContext; | |
public class PasswordValidation implements ConstraintValidator<Password, String> { | |
private static final boolean NUMBER_OF_REQUIRED_DIGITS = true; | |
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.knoldus.user; | |
import com.knoldus.user.annotation.Password; | |
import lombok.Builder; | |
import lombok.Value; | |
import javax.validation.constraints.Pattern; | |
@Value | |
@Builder |
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.knoldus.user; | |
import javax.validation.ConstraintViolation; | |
import javax.validation.Validation; | |
import javax.validation.Validator; | |
import javax.validation.ValidatorFactory; | |
import java.util.Scanner; | |
import java.util.Set; | |
public class Login { |
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
<configuration> | |
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | |
<!-- encoders are assigned the type | |
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --> | |
<encoder> | |
<pattern>%-4relative [%thread] %-5level %logger{35} - %msg %n</pattern> | |
</encoder> | |
</appender> |
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
<configuration> | |
<appender name="FILE" class="ch.qos.logback.core.FileAppender"> | |
<file>testFile.log</file> | |
<!-- encoders are assigned the type | |
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --> | |
<encoder> | |
<pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</pattern> | |
</encoder> | |
</appender> |
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
@Builder | |
@Getter | |
@AllArgsConstructor | |
public final class DeleteAddressPojo { | |
private final String uid; | |
private final DeleteAddress address; | |
} | |
@Builder |
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
DeleteAddressPojo deletePerson = DeleteAddressPojo.builder() | |
.address(DeleteAddress.builder().uid(addressUid).build()).uid(uid).build(); | |
if (daoOperation.deleteNode(deletePerson)) { | |
System.out.println("Delete Transaction completed"); | |
} | |
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 <T> boolean deleteNode(final T element) { | |
try (Transaction txn = dgraphClient.newTransaction()) { | |
try { | |
final DgraphProto.Mutation mutation = getDeleteMutation(element); | |
txn.mutate(mutation); | |
txn.commit(); | |
return true; |
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
if (daoOperation.deleteNode(Address.builder().uid(addressDeleteUid).build())) { | |
System.out.println("Delete Transaction for address completed"); | |
} |
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
@Builder | |
@Getter | |
public final class DeleteListValue { | |
private final String uid; | |
private final String hobbies; | |
} | |