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
@Bean | |
public PersistenceExceptionTranslationPostProcessor exceptionTranslation() { | |
return new PersistenceExceptionTranslationPostProcessor(); | |
} |
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
@Target({ElementType.TYPE}) | |
@Retention(RetentionPolicy.RUNTIME) | |
@Documented | |
@Component | |
public @interface Repository { | |
/** | |
* The value may indicate a suggestion for a logical component name, | |
* to be turned into a Spring bean in case of an autodetected component. | |
* @return the suggested component name, if any (or empty String otherwise) |
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
@Target({ElementType.TYPE}) | |
@Retention(RetentionPolicy.RUNTIME) | |
@Documented | |
@Component | |
public @interface Service { | |
/** | |
* The value may indicate a suggestion for a logical component name, | |
* to be turned into a Spring bean in case of an autodetected component. | |
* @return the suggested component name, if any (or empty String otherwise) |
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
@Target(ElementType.TYPE) | |
@Retention(RetentionPolicy.RUNTIME) | |
@Documented | |
@Indexed | |
public @interface Component { | |
/** | |
* The value may indicate a suggestion for a logical component name, | |
* to be turned into a Spring bean in case of an autodetected component. | |
* @return the suggested component name, if any (or empty String otherwise) |
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
@Component | |
public class MyComponent { | |
/** | |
* Can able to directly mention the value inside @Value annotation | |
*/ | |
@Value("Hello Sample") | |
private String sampleValue; | |
/** | |
* the value for the property lici.value read from the application.properties file |
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
lici.value=Hello Sample | |
lici.myproperty = Hello My Property | |
lici.array = First,Second,Third | |
lici.myrank = 4 | |
lici.underscore.values=A_B_C | |
lici.kevin.details={name: 'ajin', age: '23', country: 'india'} |
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
@Lazy | |
@Component | |
public class LazyClass { | |
public LazyClass() { | |
System.out.println(">>>>>>>>>LazyClass Initialized<<<<<<<<<<<"); | |
} | |
public void hello() { | |
System.out.println("Hello...."); |
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
@Lazy | |
@Component | |
public class LazyClass { | |
public LazyClass() { | |
System.out.println(">>>>>>>>>LazyClass Initialized<<<<<<<<<<<"); | |
} | |
} |
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
@Lazy | |
@Configuration | |
public class MyLazyConfiguration { | |
@Bean | |
public NormalClass normalClass() { | |
return new NormalClass(); | |
} | |
@Bean | |
public LazyClass lazyClass() { |
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
. ____ _ __ _ _ | |
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ | |
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ | |
\\/ ___)| |_)| | | | | || (_| | ) ) ) ) | |
' |____| .__|_| |_|_| |_\__, | / / / / | |
=========|_|==============|___/=/_/_/_/ | |
:: Spring Boot :: (v2.4.4) | |
2021-04-20 13:21:12.178 INFO 18520 --- [ main] c.lici.spring.SpringExamplesApplication : Starting SpringExamplesApplication using Java 15 on LAPTOP-13R0SDGH with PID 18520 (C:\Programming\Workspace\LearnIt_CodeIT\spring-examples\target\classes started by anish in C:\Programming\Workspace\LearnIt_CodeIT\spring-examples) | |
2021-04-20 13:21:12.180 INFO 18520 --- [ main] c.lici.spring.SpringExamplesApplication : No active profile set, falling back to default profiles: default |