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 khannedy.javatipsweekly.optional; | |
import java.util.Optional; | |
public class JavaOptional { | |
public void nullCheck(Customer customer) { | |
String name = Optional.ofNullable(customer.getName()) | |
.orElse(""); |
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
-- mysql get all childs | |
select id, | |
name, | |
parent_id | |
from (select * from tablename | |
order by parent_id, id) tablename, | |
(select @pv := '100') initialisation | |
where find_in_set(parent_id, @pv) > 0 | |
and @pv := concat(@pv, ',', id) |