<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>vGrup  Blog &#187; blob</title>
	<atom:link href="http://www.vgrup.com/tag/blob/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vgrup.com</link>
	<description>Vgrup for Geek and Robot Unix Party</description>
	<lastBuildDate>Fri, 21 May 2010 12:01:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>hibernate blob kullanarak resim kaydetme</title>
		<link>http://www.vgrup.com/2010/03/03/hibernate-blob-kullanarak-resim-kaydetme/</link>
		<comments>http://www.vgrup.com/2010/03/03/hibernate-blob-kullanarak-resim-kaydetme/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 07:16:51 +0000</pubDate>
		<dc:creator>Muhammed YÜRÜRDURMAZ</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Örnek]]></category>
		<category><![CDATA[blob]]></category>
		<category><![CDATA[Hibernate]]></category>

		<guid isPermaLink="false">http://www.vgrup.com/2010/03/03/hibernate-blob-kullanarak-resim-kaydetme/</guid>
		<description><![CDATA[
import&#160;java.io.Serializable;
import&#160;java.sql.Blob;
import&#160;javax.persistence.Column;
import&#160;javax.persistence.Entity;
import&#160;javax.persistence.GeneratedValue;
import&#160;javax.persistence.GenerationType;
import&#160;javax.persistence.Id;
import&#160;javax.persistence.JoinColumn;
import&#160;javax.persistence.Lob;
import&#160;javax.persistence.ManyToOne;
@Entity(name=&#34;resim&#34;)
public&#160;class&#160;Resim implements&#160;Serializable {
&#160;&#160;&#160;&#160;@Column(name=&#34;id&#34;)
&#160;&#160;&#160;&#160;@Id
&#160;&#160;&#160;&#160;private&#160;int&#160;id;
&#160;&#160;&#160;&#160;@Column(name=&#34;resim&#34;)
&#160;&#160;&#160;&#160;@Lob
&#160;&#160;&#160;&#160;private&#160;Blob resim;
&#160;&#160;&#160;&#160;/**
&#160;&#160;&#160;&#160; * @return&#160;the id
&#160;&#160;&#160;&#160; */
&#160;&#160;&#160;&#160;public&#160;int&#160;getId()&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return&#160;id;
&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;/**
&#160;&#160;&#160;&#160; * @param&#160;id&#160;the id to set
&#160;&#160;&#160;&#160; */
&#160;&#160;&#160;&#160;public&#160;void&#160;setId(int&#160;id)&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;this.id = id;
&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;/**
&#160;&#160;&#160;&#160; * @return&#160;the resim
&#160;&#160;&#160;&#160; */
&#160;&#160;&#160;&#160;public&#160;Blob getResim()&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return&#160;resim;
&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;/**
&#160;&#160;&#160;&#160; * @param&#160;resim&#160;the resim to set
&#160;&#160;&#160;&#160; */
&#160;&#160;&#160;&#160;public&#160;void&#160;setResim(Blob resim)&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;this.resim = resim;
&#160;&#160;&#160;&#160;}
}

Kullanım örneği

Resim r = new Resim();
r.setResim(Hibernate.createBlob(new FileInputStream("resim.jpg")));
s.save(r);


	Tags: Örnek, blob, Hibernate, Java

	Related posts
	
	hibernate jointable kullanımı (0)
	jdeveloper 11g ve tuscany (0)
	java.lang.NoSuchMethodError org.objectweb.asm.ClassWriter hatası (0)
	java tarih formatlama (SimpleDateFormat) (0)
	hinbernate&#8217;te [...]]]></description>
			<content:encoded><![CDATA[<p><font face="monospace"><br />
<font color="#a020f0">import</font>&nbsp;java.io.Serializable;<br />
<font color="#a020f0">import</font>&nbsp;java.sql.Blob;<br />
<font color="#a020f0">import</font>&nbsp;javax.persistence.Column;<br />
<font color="#a020f0">import</font>&nbsp;javax.persistence.Entity;<br />
<font color="#a020f0">import</font>&nbsp;javax.persistence.GeneratedValue;<br />
<font color="#a020f0">import</font>&nbsp;javax.persistence.GenerationType;<br />
<font color="#a020f0">import</font>&nbsp;javax.persistence.Id;<br />
<font color="#a020f0">import</font>&nbsp;javax.persistence.JoinColumn;<br />
<font color="#a020f0">import</font>&nbsp;javax.persistence.Lob;<br />
<font color="#a020f0">import</font>&nbsp;javax.persistence.ManyToOne;</p>
<p><font color="#a020f0">@Entity</font>(name=<font color="#ff00ff">&quot;resim&quot;</font>)<br />
<font color="#2e8b57"><b>public</b></font>&nbsp;<font color="#2e8b57"><b>class</b></font>&nbsp;Resim <font color="#2e8b57"><b>implements</b></font>&nbsp;Serializable {<br />
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a020f0">@Column</font>(name=<font color="#ff00ff">&quot;id&quot;</font>)<br />
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a020f0">@Id</font><br />
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#2e8b57"><b>private</b></font>&nbsp;<font color="#2e8b57"><b>int</b></font>&nbsp;id;<br />
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a020f0">@Column</font>(name=<font color="#ff00ff">&quot;resim&quot;</font>)<br />
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a020f0">@Lob</font><br />
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#2e8b57"><b>private</b></font>&nbsp;Blob resim;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff">/**</font><br />
<font color="#0000ff">&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#0000ff">* </font><font color="#6a5acd">@return</font><font color="#0000ff">&nbsp;the id</font><br />
<font color="#0000ff">&nbsp;&nbsp;&nbsp;&nbsp; */</font><br />
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#2e8b57"><b>public</b></font>&nbsp;<font color="#2e8b57"><b>int</b></font>&nbsp;getId()&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>return</b></font>&nbsp;id;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff">/**</font><br />
<font color="#0000ff">&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#0000ff">* </font><font color="#6a5acd">@param</font><font color="#008b8b">&nbsp;id</font><font color="#0000ff">&nbsp;the id to set</font><br />
<font color="#0000ff">&nbsp;&nbsp;&nbsp;&nbsp; */</font><br />
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#2e8b57"><b>public</b></font>&nbsp;<font color="#2e8b57"><b>void</b></font>&nbsp;setId(<font color="#2e8b57"><b>int</b></font>&nbsp;id)&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#2e8b57"><b>this</b></font>.id = id;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff">/**</font><br />
<font color="#0000ff">&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#0000ff">* </font><font color="#6a5acd">@return</font><font color="#0000ff">&nbsp;the resim</font><br />
<font color="#0000ff">&nbsp;&nbsp;&nbsp;&nbsp; */</font><br />
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#2e8b57"><b>public</b></font>&nbsp;Blob getResim()&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>return</b></font>&nbsp;resim;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff">/**</font><br />
<font color="#0000ff">&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#0000ff">* </font><font color="#6a5acd">@param</font><font color="#008b8b">&nbsp;resim</font><font color="#0000ff">&nbsp;the resim to set</font><br />
<font color="#0000ff">&nbsp;&nbsp;&nbsp;&nbsp; */</font><br />
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#2e8b57"><b>public</b></font>&nbsp;<font color="#2e8b57"><b>void</b></font>&nbsp;setResim(Blob resim)&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#2e8b57"><b>this</b></font>.resim = resim;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>}</p>
<p></font></p>
<p>Kullanım örneği</p>
<pre>
Resim r = new Resim();
r.setResim(Hibernate.createBlob(new FileInputStream("resim.jpg")));
s.save(r);
</pre>

	Tags: <a href="http://www.vgrup.com/tag/ornek/" title="Örnek" rel="tag">Örnek</a>, <a href="http://www.vgrup.com/tag/blob/" title="blob" rel="tag">blob</a>, <a href="http://www.vgrup.com/tag/hibernate/" title="Hibernate" rel="tag">Hibernate</a>, <a href="http://www.vgrup.com/tag/java/" title="Java" rel="tag">Java</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.vgrup.com/2010/03/18/hibernate-jointable-kullanimi/" title="hibernate jointable kullanımı (2010/03/18)">hibernate jointable kullanımı</a> (0)</li>
	<li><a href="http://www.vgrup.com/2010/01/19/jdeveloper-11g-ve-tuscany/" title="jdeveloper 11g ve tuscany (2010/01/19)">jdeveloper 11g ve tuscany</a> (0)</li>
	<li><a href="http://www.vgrup.com/2010/01/28/java-lang-nosuchmethoderror-org-objectweb-asm-classwriter-hatasi/" title="java.lang.NoSuchMethodError org.objectweb.asm.ClassWriter hatası (2010/01/28)">java.lang.NoSuchMethodError org.objectweb.asm.ClassWriter hatası</a> (0)</li>
	<li><a href="http://www.vgrup.com/2010/02/19/java-tarih-formatlama-simpledateformat/" title="java tarih formatlama (SimpleDateFormat) (2010/02/19)">java tarih formatlama (SimpleDateFormat)</a> (0)</li>
	<li><a href="http://www.vgrup.com/2010/01/21/hinbernatete-annotation-kullanarak-inheritance/" title="hinbernate&#8217;te annotation kullanarak inheritance (2010/01/21)">hinbernate&#8217;te annotation kullanarak inheritance</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.vgrup.com/2010/03/03/hibernate-blob-kullanarak-resim-kaydetme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
