Advertisement
Guest User

Untitled

a guest
Aug 1st, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. 2
  2. 7
  3. 12
  4. 17
  5. 22
  6. 27
  7.  
  8. @Entity
  9. @Indexed
  10. @Table(name="tweets_table")
  11. public class TweetPOJO implements Serializable{
  12.  
  13. private static final long serialVersionUID = 1123211L;
  14.  
  15. @Id
  16. @GeneratedValue (???)
  17. @Column(name = "raw_id" )
  18. private int raw_id;
  19.  
  20. @Column(name = "tweet_id")
  21. private String tweet_id;
  22.  
  23.  
  24. @DateBridge(resolution=Resolution.DAY)
  25. @Column(name = "posted_time")
  26. private String timestamp;
  27.  
  28. @Field(index = Index.YES, analyze = Analyze.YES, store = Store.NO)
  29. @Column(name = "cleaned_text")
  30. private String tweet_text;
  31.  
  32.  
  33. @Column(name = "hashtags")
  34. @Field(index=Index.YES, analyze=Analyze.NO, store=Store.YES)
  35. private String hashtags;
  36.  
  37. @Column(name = "media_url")
  38. private String media_url;
  39.  
  40. @Column(name = "media_text")
  41. private String media_text;
  42.  
  43. @Column(name = "media_type")
  44. private String media_type;
  45.  
  46. @Column(name = "location")
  47. private String location;
  48.  
  49. ...
  50. ...
  51. public void setUser_frind_count(int user_frind_count) {
  52. this.user_frind_count = user_frind_count;
  53. }
  54.  
  55. @Override
  56. public String toString() {
  57. return tweet_id+" : "+tweet_text;
  58. }
  59.  
  60. }
  61.  
  62. <?xml version="1.0" encoding="utf-8"?>
  63. <!DOCTYPE hibernate-configuration SYSTEM "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
  64.  
  65. <hibernate-configuration>
  66. <session-factory>
  67.  
  68. <property name="hibernate.bytecode.use_reflection_optimizer"> true </property>
  69. <property name="hibernate.dialect"> org.hibernate.dialect.MySQLDialect </property>
  70. <property name="hibernate.connection.driver_class"> com.mysql.jdbc.Driver </property>
  71.  
  72. <!-- Assume test is the database name -->
  73. <property name="hibernate.connection.url"> jdbc:mysql://*******/clouddata </property>
  74. <property name="hibernate.connection.username"> root </property>
  75. <property name="hibernate.connection.password"> qwe123 </property>
  76.  
  77.  
  78. <property name="connection.pool_size"> 1 </property>
  79. <property name="hibernate.search.default.directory_provider"> filesystem </property>
  80.  
  81. <property name="hibernate.search.default.indexBase"> E:lucene_index </property>
  82. <!--
  83. whether the schema will be created or just updated, every time the sessionFactory is created.
  84. This is configured in the hibernate.hbm2ddl.auto property, which is set to update. So the schema
  85. is only updated. If this property is set to create, then every time we run our application, the
  86. schema will be re-created, thus deleting previous data.
  87. -->
  88. <property name="hibernate.hbm2ddl.auto">update</property>
  89. <mapping class="twitter_crawling_modul.TweetPOJO"/>
  90. </session-factory>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement