enpy 8209ec4a1f Difference between CDI and EJB singleton (#6915)
* Singleton injection examples and tests added

* code and tests implemented
2019-05-08 08:40:54 -06:00

24 lines
409 B
Java

package com.baeldung.singleton;
import java.util.UUID;
import javax.enterprise.context.Dependent;
import org.springframework.web.context.annotation.RequestScope;
@RequestScope
public class CarServiceBean {
private UUID id = UUID.randomUUID();
public UUID getId() {
return this.id;
}
@Override
public String toString() {
return "CarService [id=" + id + "]";
}
}