- MySQL Functions
LAST_INSERT_ID Function The LAST_INSERT_ID functions returns the last id of the column that uses AUTO_INCREMENT for its id. It’s also important to know that this function has be called after an insert or else if you just call it without an insert statement it will give you 0. REPLACE Function…
- Spring Boot Api Authentication
Spring boot security
- Spring Boot Security @Secured on method level
First, authorities need to be loaded into the Authentication. On the method level use @Secured
- Spring Data Query to DTO
We will show here how you can map a DTO to a query using constructor. First create your entity class. Here we will have a User class. Second create your DTO class. In this case we will have a UserDto. As you can see that all fields and values must be loaded into the UserDto […]
- Spring Data Native Query to DTO
Let’s show how you can map a native SQL query to a DTO directly. Using AliasToBeanResultTransformer All the fields in the DTO, in this case UserFullDto, must have the same names as the result set returned from the query. If a query field name is not found in the dto then it will through an […]