Re: Best Practice for blobs

"Jurgen Doll" <[email protected]>
Newsgroups gmane.comp.java.cayenne.user
Message-ID <FAA76B10921345D59EC0CF516E41B030@IV5>
Hi Lon

Not sure if this is best practice but I created two Cayenne object entities 
where the first excludes the blob and the second only has the blob.

Then I either:

1. Added a relationship attribute in the first pointing to the second, based 
on a 1:1 relationship in the DbEntity.

2. Or I manually added a method to the first, to fetch the blob with 
something like:

    Cayenne.objectForPK( context, ImageBlob.class, 
Cayenne.longPKForObject( this ) );

Jurgen


-----Original Message----- 
From: Lon Varscsak
Sent: Thursday, October 3, 2019 1:55 AM
To: Apache Cayenne
Subject: Best Practice for blobs

Hey all,

I have a blob column in an entity, but I don't want to always actually load
the blob, just on demand (but I still want to be able to see the other
attributes in the entity).  Any best practice here to have the blob be lazy?

Thanks,

Lon
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.