Question: I have the following scenario:  

I'm having troubles figuring out what the owner side is and why ?
Please can you help ?

```
public class Basket
{

...

@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    @JoinColumns({@JoinColumn(name="BASKET", referencedColumnName="ID")})   
    public Set<Product> getProductList() {
        return this.productList;
    }
}

public class Product
{

@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
    @JoinColumns({@JoinColumn(name="BASKET", referencedColumnName="ID")})
    public Basket getBasket() {
        return this.basket;
    }

}

```

Answer: 
This would work :

```
year_list<-as.numeric(substr(as.numeric(l),1,4))
month_list<-as.numeric(substr(as.numeric(l),5,6))

```

Example 1:

```
> l <- c(200101, 200102 ,200103, 200104)
> l
[1] 200101 200102 200103 200104

> year_list<-as.numeric(substr(as.numeric(l),1,4))
> year_list
[1] 2001 2001 2001 2001

> month_list<-as.numeric(substr(as.numeric(l),5,6))
> month_list
[1] 1 2 3 4

```

Example 2:

```
> l <- c(200701, 200802 ,200903, 201604)
> year_list<-as.numeric(substr(as.numeric(l),1,4))
> year_list
[1] 2007 2008 2009 2016
> month_list<-as.numeric(substr(as.numeric(l),5,6))
> month_list
[1] 1 2 3 4

```
We can use `strsplit` from `base R`

```
 do.call(rbind, lapply(strsplit(as.character(l), 
                  '(?<=.{4})', perl=TRUE), as.numeric))

```

---

Or another `base R` option by creating a delimiter between the characters and use `read.csv`

```
read.csv(text=sub("(.{4})(.{2})", "\\1,\\2", l), header=FALSE, 
           col.names= c("Year", "Month"))
#   Year Month
#1 2001     1
#2 2001     2
#3 2001     3
#4 2001     4

```