gt;> private Long id;
>>
>> @ManyToOne
>> @JoinColumn(name = "account_id")
>> private Account account;
>> }
>>
>> public class Account {
>> @Id
>> @Column(name = "id")
>> @GeneratedValue(strategy = GenerationType.SEQUENCE, generator =
>> "AccountSequenceGenerator")
>> private Long id;
>> }
>>
>> Account account = entityManager.find(Account.class, 215L);
>> Voucher voucher = new Voucher();
>> Voucher.setAccount(account);
>> entityManager.persist(voucher);
>>
>>
>>
>>
>>
>>
>>
>
>
>
--
View this message in context:
http://n2.nabble.com/persistence-problem-in-distributed-environment-tp2619875p2915723.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
Does the test below fail for you? It works correctly for Ravi. Can you
send an example that demonstrates the problem?
On 4/13/2009 8:08 AM, hmmahboobi wrote:
Hi
Thanks for your response,
This model is a small view of our large system,
Actual codes are very large and complex, so I cant send
tor")
private Long id;
}
Account account = entityManager.find(Account.class, 215L);
Voucher voucher = new Voucher();
Voucher.setAccount(account);
entityManager.persist(voucher);
--
View this message in context:
http://n2.nabble.com/persistence-problem-in-distributed-environment-tp2619875p2628161.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
tedValue(strategy = GenerationType.SEQUENCE, generator =
"AccountSequenceGenerator")
private Long id;
}
Account account = entityManager.find(Account.class, 215L);
Voucher voucher = new Voucher();
Voucher.setAccount(account);
entityManager.persist(voucher);
--
View this message in context
d")
> private Account account;
> }
>
> public class Account {
> @Id
> @Column(name = "id")
> @GeneratedValue(strategy = GenerationType.SEQUENCE, generator =
> "AccountSequenceGenerator")
> private Long id;
> }
>
> Account account = entityManager.find(Account.class, 215L);
> Voucher voucher = new Voucher();
> Voucher.setAccount(account);
> entityManager.persist(voucher);
>
>
>
>
>
--
View this message in context:
http://n2.nabble.com/persistence-problem-in-distributed-environment-tp2619875p2622901.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator =
> "AccountSequenceGenerator")
> private Long id;
> }
>
> Account account = entityManager.find(Account.class, 215L);
> Voucher voucher = new Voucher();
> Voucher.setAccount(account);
> entityManager.persist(voucher);
>
>
>
>
>
--
View this message in context:
http://n2.nabble.com/persistence-problem-in-distributed-environment-tp2619875p2622747.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
"unmanaged" means the Account object assigned to the ManyToOne field is
new and not yet persistent, removed, or detached.
On 4/11/2009 7:46 AM, rpalache wrote:
Hi,
"Set the cascade attribute for this field to CascadeType.PERSIST or CascadeType.ALL (JPA annotations) or
"persist" or "all" (JPA
Account account = entityManager.find(Account.class, 215L);
Voucher voucher = new Voucher();
Voucher.setAccount(account);
entityManager.persist(voucher);
--
View this message in context:
http://n2.nabble.com/persistence-problem-in-distributed-environment-tp2619875p2620799.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
.SEQUENCE, generator =
"AccountSequenceGenerator")
private Long id;
}
Account account = entityManager.find(Account.class, 215L);
Voucher voucher = new Voucher();
Voucher.setAccount(account);
entityManager.persist(voucher);
--
View this message in context:
http://n2.nabble.com