Questions tagged as 'annotation'

1
answer

What is the difference between @PostConstruct and the constructor?

What's different about using the @PostConstruct annotation instead of using constructor method and its advantages? I ask based on these two versions of the same class that only differ by this annotation. Before @Repository public class Old...
asked by 14.04.2015 / 19:41
1
answer

What is the difference between annotation in method and annotation in attribute

Now, I've started to learn and use hibernate recently, and when looking for answers to my questions regarding annotations I've come across the following occasions: 1st) The attribute has the annotation @Column private String descrica...
asked by 23.07.2015 / 15:58
2
answers

Is it possible to change the value of a note at run time?

Considering the following annotation: @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface MinhaAnotacao { String valor(); } Defined in a class: @MinhaAnotacao(valor = "algum valor") class ExemploStackOverflo...
asked by 26.05.2016 / 04:23
1
answer

How to populate a select or checkbox dynamically using annotations in the Zend Form ZF 2?

I learned to do this with fixed values, eg: @Annotation\Type("Zend\Form\Element\Select") @Annotation\Options({"label":"Cidade"}) @Annotation\Attributes({"options":{"1":"São Paulo","2":"Rio de Janeiro"}}) However, how do I put these options...
asked by 13.07.2015 / 21:40
1
answer

When should I use the annotation @EnableAutoConfiguration and how does it work?

Annotation EnableAutoConfiguration should be used on what kind of project? and how does it work in the application?     
asked by 05.06.2015 / 01:16
1
answer

I can not ignore fields when trying to return them as Json causing "Infinite recursion"

I'm working with Hibernate , Spring and Jackson (to ignore the fields) and trying to return the User < strong> in a request json java returns error due to @OneToMany and @ManyToOne mapping with the Profile class. Does anyone know why?...
asked by 11.03.2016 / 06:57
2
answers

Scope equivalent to @Stateless in CDI

I'm migrating the EJB annotations of my application to CDI and I have some questions: What is the scope equivalent to @Stateless of EJB in CDI? Would @ResquestScoped do equivalent behavior? I have tested using @State...
asked by 11.09.2017 / 00:44
1
answer

How to structure the hibernate Entity relationship annotations?

I would like to understand the difference between hibernate annotations with JPA: @OneToOne, @OneToMany, @ManyToMany and @ManyToOne of hibernate, how does it work?     
asked by 22.07.2015 / 18:59
1
answer

Spring Framework @Transactional Operation

1 - Does the Spring documentation describe the use of @Transactional of Spring in business rule classes ( ProdutosService for example) has any special reason to use this annotation in these classes instead of using DAO's? 2 - Th...
asked by 24.07.2014 / 21:31
1
answer

Is it possible to know which JEE Container is being used during Dispatcher Servlet initialization?

After some difficulties with the use of Spring Security and JBoss using annotations based on API Servlet 3 (Servlet 3.1 specifically), I found that when using the Spring with JBoss , particularly JBoss EAP 6.1+,...
asked by 10.07.2015 / 18:24