Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2
- 7
- 12
- 17
- 22
- 27
- @Entity
- @Indexed
- @Table(name="tweets_table")
- public class TweetPOJO implements Serializable{
- private static final long serialVersionUID = 1123211L;
- @Id
- @GeneratedValue (???)
- @Column(name = "raw_id" )
- private int raw_id;
- @Column(name = "tweet_id")
- private String tweet_id;
- @DateBridge(resolution=Resolution.DAY)
- @Column(name = "posted_time")
- private String timestamp;
- @Field(index = Index.YES, analyze = Analyze.YES, store = Store.NO)
- @Column(name = "cleaned_text")
- private String tweet_text;
- @Column(name = "hashtags")
- @Field(index=Index.YES, analyze=Analyze.NO, store=Store.YES)
- private String hashtags;
- @Column(name = "media_url")
- private String media_url;
- @Column(name = "media_text")
- private String media_text;
- @Column(name = "media_type")
- private String media_type;
- @Column(name = "location")
- private String location;
- ...
- ...
- public void setUser_frind_count(int user_frind_count) {
- this.user_frind_count = user_frind_count;
- }
- @Override
- public String toString() {
- return tweet_id+" : "+tweet_text;
- }
- }
- <?xml version="1.0" encoding="utf-8"?>
- <!DOCTYPE hibernate-configuration SYSTEM "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
- <hibernate-configuration>
- <session-factory>
- <property name="hibernate.bytecode.use_reflection_optimizer"> true </property>
- <property name="hibernate.dialect"> org.hibernate.dialect.MySQLDialect </property>
- <property name="hibernate.connection.driver_class"> com.mysql.jdbc.Driver </property>
- <!-- Assume test is the database name -->
- <property name="hibernate.connection.url"> jdbc:mysql://*******/clouddata </property>
- <property name="hibernate.connection.username"> root </property>
- <property name="hibernate.connection.password"> qwe123 </property>
- <property name="connection.pool_size"> 1 </property>
- <property name="hibernate.search.default.directory_provider"> filesystem </property>
- <property name="hibernate.search.default.indexBase"> E:lucene_index </property>
- <!--
- whether the schema will be created or just updated, every time the sessionFactory is created.
- This is configured in the hibernate.hbm2ddl.auto property, which is set to update. So the schema
- is only updated. If this property is set to create, then every time we run our application, the
- schema will be re-created, thus deleting previous data.
- -->
- <property name="hibernate.hbm2ddl.auto">update</property>
- <mapping class="twitter_crawling_modul.TweetPOJO"/>
- </session-factory>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement