This file contains hidden or 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 interface ChannelRepository extends JpaRepository<Channel, Long>{ | |
@Query(value = "select new com.reyun.lizard.service.model.KeyValue(str(a.channel),a.surl) from Campaign a where a.channel in (?1)") | |
List<KeyValue> findSurl(List<Long> channels); | |
} |
This file contains hidden or 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 class SingletonOne | |
{ | |
private static SingletonOne singletonOne = null; | |
private SingletonOne() | |
{ | |
} | |
public static SingletonOne getInstance() | |
{ |
This file contains hidden or 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 class SingletonTwo | |
{ | |
private static SingletonTwo singletonTwo; | |
private SingletonTwo() | |
{ | |
} | |
public static synchronized SingletonTwo getSingletonTwo() | |
{ |
This file contains hidden or 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
/** | |
* description: | |
* 在多线程环境下,有可能在实例未完成的情况下进行调用出现错误 | |
* @author nolan | |
* @date 09/08/2017 | |
*/ | |
public class SingletonThreee | |
{ | |
private static SingletonThreee singletonThreee; |
This file contains hidden or 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 class SingleFour | |
{ | |
private static class SingleHolder { | |
private static SingleFour instance = new SingleFour(); | |
} | |
public static SingleFour getInstance(){ | |
return SingleHolder.instance; | |
} | |
} |
This file contains hidden or 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 class SingletonFive | |
{ | |
private static SingletonFive singletonFive; | |
private SingletonFive() | |
{ | |
} | |
public static SingletonFive getInstance() | |
{ |
This file contains hidden or 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
/** | |
* description: | |
* 在多线程环境下,有可能在实例未完成的情况下进行调用出现错误 | |
* @author nolan | |
* @date 09/08/2017 | |
*/ | |
public class SingletonThree | |
{ | |
private static SingletonThree singletonThree; |
This file contains hidden or 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 class SingletonThree | |
{ | |
private static volatile SingletonThree singletonThree; | |
private SingletonThree() | |
{ | |
} | |
public static SingletonThree getInstace() | |
{ |
This file contains hidden or 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 interface Logger | |
{ | |
void log(String message); | |
} |
This file contains hidden or 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 class XMLLogger | |
implements Logger | |
{ | |
public void log(String message) | |
{ | |
} | |
} |
OlderNewer